very weird compilation bug

Monkey Forums/Monkey Bug Reports/very weird compilation bug

ziggy(Posted 2014) [#1]
This does not compile:
Import dom
Function Main()
	Local elem:= document.getElementById("GameCanvas")
	If elem <> Null
		Local nodesList:NodeList = elem.childNodes
		Print "Items + " nodesList.length
	EndIf
End

It complains that the length identifier does not exists, but this is the implementation of a NodeList:
Class NodeList Extends DOMObject
	Field length
	Method item:Node( index )
End

Something weird happening here


marksibly(Posted 2014) [#2]
Try:

Print "Items " + nodesList.length

The error is misleading though...


ziggy(Posted 2014) [#3]
pffff... I feeel sooooooooo stupid right now. I've been several hours looking at the source... But I agree the error is not very self explanatory