diff options
| -rw-r--r-- | TODO | 1 | ||||
| -rw-r--r-- | src/vm.rs | 4 | ||||
| -rw-r--r-- | tests/simple.tdy | 10 |
3 files changed, 8 insertions, 7 deletions
@@ -1,5 +1,4 @@ PONG -- structs in structs - foreign function - constructors? ({.x = }-ish) - foreign structs @@ -596,10 +596,6 @@ impl VM { values.push(Value::Nil); } - for (slot, ty) in blob.name_to_field.values() { - values[*slot] = ty.as_value(); - } - self.stack.pop(); self.stack.push(Value::BlobInstance(blob_id, Rc::new(RefCell::new(values)))); } diff --git a/tests/simple.tdy b/tests/simple.tdy index de6841b..7ecac8b 100644 --- a/tests/simple.tdy +++ b/tests/simple.tdy @@ -1,18 +1,24 @@ +blob B { + a: int +} + blob A { a: int - b: int + b: B c: float } hello : fn A -> = fn a: A { print a.a print a.b + print a.b.a print a.c } a := A() a.a = 1 -a.b = 2 +a.b = B() +a.b.a = 2 a.c = 3. hello(a) |
