luau-lang / luau

A fast, small, safe, gradually typed embeddable scripting language derived from Lua
https://luau.org
MIT License
3.98k stars 373 forks source link

Luau Debugger Triggered, var name for function same as for table along with typeof #1196

Closed karl-police closed 6 months ago

karl-police commented 6 months ago
local test = {
    [game.Workspace] = true
}

function test(a: keyof<typeof(test)>)

end

Triggers it too:

local test = {
    [game.Workspace] = true
}

function test(a: typeof(test))

end

image

Immediately gets triggered upon copy-pasting the snippet onto Studio.

vegorov-rbx commented 6 months ago

Luau project doesn't have this 'Studio' you are talking about, please report the issues in the correct place.

karl-police commented 6 months ago

Luau project doesn't have this 'Studio' you are talking about, please report the issues in the correct place.

https://github.com/luau-lang/luau/discussions/1192#discussioncomment-8762970

I was told to file an issue with the code snippet. I included a screenshot for some random reason as well 🤷

aatxe commented 6 months ago

This issue doesn't do a good job of describing what you were actually experiencing. It looks like you were testing the new type inference engine, which you enabled with the fflag DebugLuauDeferredConstraintResolution, and you encountered a crash. This is a valid bug for Luau (though chances are it's been fixed already since it's been a month), but since you didn't describe your issue, it seemed like it might've been an issue with Studio, which is not part of Luau.

karl-police commented 6 months ago

This issue doesn't do a good job of describing what you were actually experiencing. It looks like you were testing the new type inference engine, which you enabled with the fflag DebugLuauDeferredConstraintResolution, and you encountered a crash. This is a valid bug for Luau (though chances are it's been fixed already since it's been a month), but since you didn't describe your issue, it seemed like it might've been an issue with Studio, which is not part of Luau.

The issue was that the type completion crashed on Studio, but I couldn't repro this with any Luau Binary.