Curious compiler error message.

Monkey Forums/Monkey Bug Reports/Curious compiler error message.

ziggy(Posted 2012) [#1]
Code:
Function Main()
	Local variable:MyClass
	variable
End

Class MyClass
End


The error message is sort of funy:
Error : Identifier 'variable' not found - perhaps you meant 'variable'?

Just a minor cosmetic thingy, but shoudn't it be something like: A class instance can't be invoked, or the like?


Citty(Posted 2014) [#2]
[variable] might no be identified


Goodlookinguy(Posted 2014) [#3]
Just a minor cosmetic thingy, but shoudn't it be something like: A class instance can't be invoked, or the like?


No, because it could just be null. Accessing a null variable does not mean accessing its fields and methods. The error C#.NET gives, a tad more appropriately, is "Only assignment, call, increment, decrement, and new object expressions can be used as a statement".

Edit: Didn't realize this was a revived thread. I read it as only being hours ago and not years ago. The error reported by Monkey X now still doesn't make much sense, but at least it doesn't say what it used to say. Now all it reports is "Error : Identifier 'variable' not found".


Citty(Posted 2014) [#4]
Let me be more specific. The compiler thinks that "variable" is unidentified so it is best that you identify it instead of leaving it