-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support parsing function attributes #336
Comments
Can you paste the code that is causing the crash? |
This error was from a production repository with a non permissive license; however I was able to create a reproduction below: --[[
1. Create a generic
2. @native function
3. cast return of @native function to typeof(fn())?
4. unreachable!()
]]
-- can also be type Message<T> = T
type Message<T> = {
time: number,
data: T
}
-- must be @native
@native
local function fn(keys: { [string]: string }?): { [string]: Secret | string } end
-- must death cast
local headers = (fn() :: typeof(fn())?) |
Nevermind; you do not need a generic to trigger this: Message can also be Message; e.g. type A = unknown
@native local function fn(k: { [string]: string }?): { [string]: Secret | string } end
fn(fn() :: typeof(fn())?) In fact, all you need is this, and full_moon panics: type A = unknown
@native function fn() end |
I don't think full moon supports function attributes yet, which seems to be the main issue. Although i'm not sure why we end up panicking in that case |
Will repurpose this issue to support parsing function attributes, which should in the end stop this particular crash. If we see the crash again, will make a separate issue for it |
https://docs.rs/full_moon/1.1.2/src/full_moon/ast/parsers.rs.html#2571
The typed code includes unions and intersections, and does not have any code which directly uses the new solver.
I am also not sure if this is darklua's fault or full_moon's fault.
The text was updated successfully, but these errors were encountered: