teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.11k stars 109 forks source link

Compiler crashes with "attempt to index a nil value (local 't')" #526

Closed Voycawojka closed 2 years ago

Voycawojka commented 2 years ago

To reproduce

Save the following code to either a .tl or .lua file:

Entity = {}

function Entity.action()
end

and run tl check on it. I would expect a complaint about Entity not being declared. Instead, the following popup appears (I'm including a screenshot since I can't select the message to copy it):

image

Environment

hishamhm commented 2 years ago

That's very strange! I cannot reproduce it locally. We got a similar report in #535 on macOS as well...

hishamhm commented 2 years ago

On further investigation, this does look like #470, which was already fixed (I can reproduce your error with 0.13.2, but not with master which contains the fix from #470). The report from @Frityet in #535, however, said it even happened on any code, and that I cannot reproduce.

hishamhm commented 2 years ago

This should be fixed in 0.14. I'm going to close this; feel free to reopen if the problem reappears!