diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-01-29 20:14:51 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-01-29 20:14:51 +0100 |
| commit | 5df50ecccae28fc41461637b7bde1cdb383da30e (patch) | |
| tree | eba9303027573971e2d2902485177b6016ea7f83 | |
| parent | c16f77289248633fb3229877e33e5e68dd27a826 (diff) | |
| download | sylt-5df50ecccae28fc41461637b7bde1cdb383da30e.tar.gz | |
blobs in blobs
| -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) |
