Issue Details (XML | Word | Printable)

Key: BOO-1042
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Cedric Vivier
Reporter: Cedric Vivier
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Invalid IL generated when ctor calls an instance method before self() or super()

Created: 03/Jun/08 08:38 AM   Updated: 22/Jan/09 09:22 AM   Resolved: 03/Jun/08 01:29 PM
Return to search
Component/s: Compiler
Affects Version/s: 0.8.2, 0.9
Fix Version/s: 0.9

Time Tracking:
Not Specified

Testcase included: yes


 Description  « Hide

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 ?



Cedric Vivier added a comment - 03/Jun/08 01:29 PM

fixed in rev. 2991