polserver/testsuite/escript/classes/super-bad-class.src
Kevin Eady 0fa1b893a0 Update core-changes, break-changes for classes support (#719)
* Format testsuite escript

* Format testsuite pol

* Update docs
Switch "attributes" to "members" to better align with Escript terms.

* Add core-changes, breaking-changes
2024-10-10 18:06:04 +02:00

21 lines
420 B
Text

// Do not call super() if the `this` is invalid
class BaseClass()
function BaseClass( this )
print( $"BaseClass::BaseClass this={this}" );
endfunction
endclass
class Foo( BaseClass )
function Foo( this )
super();
print( $"Foo::Foo this={this}" );
endfunction
endclass
print( Foo() );
print( "----" );
// Will call Foo() but not BaseClass(), as super() is skipped
print( @Foo.call( struct{} ) );