mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* Format testsuite escript * Format testsuite pol * Update docs Switch "attributes" to "members" to better align with Escript terms. * Add core-changes, breaking-changes
43 lines
586 B
Text
43 lines
586 B
Text
/*
|
|
|
|
Diamond problem:
|
|
|
|
A
|
|
/ \
|
|
B C
|
|
\ /
|
|
D
|
|
|
|
Currently, super will end up calling A ctor twice. This will be fixed with executor implementations.
|
|
|
|
*/
|
|
|
|
class A()
|
|
function A( this, a0 )
|
|
print( "A" );
|
|
endfunction
|
|
endclass
|
|
|
|
class B( A )
|
|
function B( this, b0 )
|
|
super( b0 );
|
|
print( "B" );
|
|
endfunction
|
|
endclass
|
|
|
|
class C( A )
|
|
function C( this, c0 )
|
|
super( c0 );
|
|
print( "C" );
|
|
endfunction
|
|
endclass
|
|
|
|
class D( B, C )
|
|
function D( this, d0 )
|
|
super( B::b0:= d0, C::c0:= d0 );
|
|
print( "D" );
|
|
endfunction
|
|
endclass
|
|
|
|
var obj := D( "foo" );
|
|
print( obj );
|