polserver/testsuite/escript/classes/doc-sample-10.src
Kevin Eady 0988c17f29 Add classes documentation (#717)
* Add escript guide docs for classes

* Add ClassInstanceRef to objref docs

* Use objref.dot to generate svg
2024-10-10 18:06:04 +02:00

22 lines
335 B
Text

class A()
function A( this )
endfunction
endclass
class B()
function B( this )
endfunction
endclass
class C( A, B )
function C( this )
super();
endfunction
endclass
var c := C();
Print( c is @C ); // Output: 1
Print( c is @A ); // Output: 1 (since C is a subclass of A)
var b := B();
Print( b is @C ); // Output: 0