Normally, if there is an object Obj with a property prop such that
Obj.prop==NULL, Obj.prop()==0. Also, if prop is an additive property and Obj
inherits from Class1, Class2, and Class3 (in that order), calling Obj.prop()
will result in an additional calls to Obj.Class1::prop() if the property
routine provided by Obj returns false. If Obj.Class1::prop() returns false,
Obj.Class2::prop() will be called, and Obj.Class3::prop() will be called if
THAT returns false. However, if an intermediate class in the hierarchy defines prop as NULL,
the property routines of classes higher up the hierarchy will never be
called. So, if Class2 defines prop as NULL, Obj.Class3::prop() will NOT be
called when it should. However, the return value of the Obj.prop() call in
this case is still 0. The result is that any class which defines an additive property as NULL
will break the code -- silently. None submitted. It seems deliberate that the veneer works this way,
and IMHO it shouldn't be changed, just better documented.
About Patches
Issue C62104
Additive property of NULL fails silently
Submitted by: Brendan Barnwell
Appeared in: Compiler 6.21 or before
Fixed in: -
Problem
Solution
Update (by Cedric Knight)
Last updated 17 April 2013.
This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation.
Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Roger Firth.