Phase 8.4: Complete AST→MIR Lowering - Basic object operations implemented
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
14
test_user_defined_box.nyash
Normal file
14
test_user_defined_box.nyash
Normal file
@ -0,0 +1,14 @@
|
||||
box DataBox {
|
||||
init { value }
|
||||
|
||||
pack(v) {
|
||||
me.value = v
|
||||
}
|
||||
}
|
||||
|
||||
static box Main {
|
||||
main() {
|
||||
local obj = new DataBox(42)
|
||||
return obj.value
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user