Currently we generate invalid IL when one calls an instance method on the object being constructed before a explicit self()/super() call :
class Test:
def constructor():
pass
def constructor(x as int):
CallBeforeSelfOrSuper() #invalid IL "uninitialized `this`"
self()
def CallBeforeSelfOrSuper():
print "before"
ECMA-335 partition III section 1.8.1.4 states :
No operations can be performed on an uninitialized this except for storing into and loading from the object's fields.
I'm not sure how we could make this work other than emitting an error when there is such a call ?
Description
Currently we generate invalid IL when one calls an instance method on the object being constructed before a explicit self()/super() call :
class Test:
def constructor():
pass
def constructor(x as int):
CallBeforeSelfOrSuper() #invalid IL "uninitialized `this`"
self()
def CallBeforeSelfOrSuper():
print "before"
ECMA-335 partition III section 1.8.1.4 states :
No operations can be performed on an uninitialized this except for storing into and loading from the object's fields.
I'm not sure how we could make this work other than emitting an error when there is such a call ?
fixed in rev. 2991