Menu

#6 invalid _parms_ values in overridden methods

open
nobody
None
5
2009-08-01
2009-08-01
Anonymous
No

Using _parm_ in an overridden method its value obviously is undefined.
This is shown in the following (oversimplifyed) code.
Enabling the #print statement will show that _parms_ has an extremely large positive random number.

program ParmsBug;

type
RootClass: class
method someMethod;
endclass;

DerivedClass: class inherits( RootClass )
override method someMethod;
endclass;

readonly
vmt( RootClass );
vmt( DerivedClass );

method RootClass.someMethod;
@noframe;
begin someMethod;
ret( _parms_ );
end someMethod;

method DerivedClass.someMethod;
@noframe;
begin someMethod;
//#print( "_parms_ = " + string( _parms_ ))
ret( _parms_ );
end someMethod;

begin ParmsBug;

end ParmsBug;

/*
HLA 1.106 gives the following error message:
Error in file "ParmsBug.hla" at line 30 [errid:89413/hlaparse.bsn]:
Expected 32-bit non-negative constant.
Near: << ) >>
*/

Discussion


Log in to post a comment.

MongoDB Logo MongoDB