polserver/testsuite/escript/classes/scopes-01.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

17 lines
404 B
Text

// Animal::StaticFunc refers to itself without scope. It should prefer its own definition over ::StaticFunc.
class Animal()
function StaticFunc( foo )
if ( foo )
print( $"Animal::StaticFunc foo={foo}" );
StaticFunc( foo - 1 );
endif
endfunction
endclass
function StaticFunc( foo )
print( $"::StaticFunc foo={foo}" );
endfunction
Animal::StaticFunc( 3 );
StaticFunc( "bar" );