Open HurryStarfish opened 5 years ago
Is the issue still valid?
Update to this issue: Only the last two ones are still wrongly treated as "method" or "function" call.
Function Test:Int()
Local o:T = New T
'Return T.F ' "Unable to convert from Int() to Int"
'Return T.M ' "Method 'M' cannot be accessed from here."
'Return o.F ' "Unable to convert from Int() to Int"
'Return o.M ' "Method cannot be used as a function pointer"
'Return New T.M ' compiles and runs -> 1
'Return New T.F ' compiles and runs -> 2
End Function
Bug Report
Expected Behavior
Any of the above
Return
statements, when uncommented, should result in a compile error, since function/method names not followed by parentheses may only be interpreted as calls when they are statements, not when they are expressions. This should be "Unable to convert from Int() to Int" for the lines including.F
; possibly a different message for the lines including.M
, as it is not currently allowed to treat a method as a value (or, in the case ofReturn T.M
, to reference it from its type name instead of an object).Actual Behavior
see the code comments