polserver/testsuite/escript/struct/struct010.src
turleypol 6ff48974cc
Code cleanup (structs and container add) (#842)
* BStruct cleanup

* container::add method has now a parameter for the position. reduces the
ambigous setposition calls.
And makes it clearer where the item is created.
removed in the touched headers the non needed virtual.

* removed exception when accessing a struct via an integer, no need to
crash the shard

* fixed test

* missed one virtual
2026-01-03 23:02:53 +01:00

13 lines
223 B
Text

program foo()
var d := 57 + 8, e := "abc";
var t := struct{ a := 4, b := 9, c := 12 };
print( t["b"] );
print( t[2] ); // this should die
print( t["c"] := 42 );
print( t[2] := 42 );
print( t );
endprogram