polserver/testsuite/escript/struct/struct013.src

11 lines
362 B
Text
Raw Permalink Normal View History

2026-08-10 21:17:03 +02:00
// struct.size() takes no parameters, and a packed struct counts its members with a length
// then a colon, so a malformed count is reported rather than assumed.
var st := struct{ x := 1, y := 2 };
print( st.size() );
print( st.size( 1 ) );
print( st.size( 1, 2 ) );
// An unknown method is still looked up by name at runtime.
print( st.no_such_method( 1 ) );