weekly 2024-01-08
MoonBit Update
-
Now we have removed the
interfacekeyword officially, replacing it withtrait. -
Based on community feedback, we've introduced the syntax
let mutid = exprto replacevar id = expr. Support forvar id = exprwill be removed next week. -
Added
Defaultimplementation for theArraytype:
fn init {
debug(Array::default()) // []
}
- Added
Default,Eq, andDebugimplementations for theListtype:
fn init {
let l1: List[_] = Cons(1, Cons(2, Cons(3, List::default())))
let l2: List[_] = Cons(1, Cons(2, Cons(4, Nil)))
debug(l1) // Cons(1, Cons(2, Cons(3, Nil)))
debug(l1 == l2) // false
debug(l2 == l2) // true
}
- Fixed type checking for public function bodies. For example:
priv type T
pub fn f() {
let t: T = ... // public definition cannot depend on private type
...
}
This used to cause an error in T, it will no longer result in such an issue.
Plugin Update
-
We've integrated the MoonBit AI, now available at https://ai.moonbitlang.com, feel free to try it.
-
Resolved several issues to enhance the stability of the LSP, preventing unexpected crashes.
Build System Update
-
Fixed an issue where
moon testwould test packages in the.mooncakesfolder. -
Deprecated
moon check --daemon. -
Improved error messages for incorrect format or content in
moon.pkg.json.
