moonscript icon indicating copy to clipboard operation
moonscript copied to clipboard

Compiler broken with a\a\a

Open buckle2000 opened this issue 7 years ago • 7 comments

Compiling a\a.a

Compile error: Short-dot syntax must be called within a with block

Compiling a\a\a The v0.5.0 compiler broke 😞

buckle2000 avatar Jan 08 '17 02:01 buckle2000

Same here 😢

sigmasoldi3r avatar Jun 27 '17 00:06 sigmasoldi3r

It should break on both: a:a.a() is not valid Lua, and a:a:a() is definitely not valid Lua.

RyanSquared avatar Jun 27 '17 01:06 RyanSquared

Wooops! My bad! You're true... (Tonight was late) it should be a.a\a!

This issue should be closed.

sigmasoldi3r avatar Jun 27 '17 09:06 sigmasoldi3r

Well, I mean the compiler should not exit immediately but give some error messasge instead.

buckle2000 avatar Jun 29 '17 13:06 buckle2000

@buckle2000 - that is true; the issue should remain open as long as the compiler fatal-errors because of that.

RyanSquared avatar Jun 29 '17 17:06 RyanSquared

What fixed this problem for me was changing it to a\b!\c instead of just a\b\c

svermeulen avatar Apr 20 '19 20:04 svermeulen

There's various different causes for this, the point is that the compiler needs to be able to tell the user that using the OOP syntax sugar doesn't work more than once per function call/stub creation.

RyanSquared avatar Apr 22 '19 01:04 RyanSquared