Skip to content
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

any as generic T incompatible with {T} in new type solver's strict mode #1268

Open
Ketasaja opened this issue May 26, 2024 · 0 comments
Open
Labels
bug Something isn't working new solver This issue is specific to the new solver.

Comments

@Ketasaja
Copy link

Ketasaja commented May 26, 2024

--!strict
function f<T>(a : {T}, b : T)
end

f({}, nil :: any) -- TypeError: Type 'number' could not be converted into 'number' in an invariant context

table.insert({} :: {any}, nil :: any) -- TypeError: None of the overloads for function that accept 2 arguments are compatible.

Tested on 0.627, with no errors in non-strict mode.

@Ketasaja Ketasaja added the bug Something isn't working label May 26, 2024
@Ketasaja Ketasaja changed the title any as generic <T> does not fit into ` any as generic T incompatible with {any} as generic {T} in new type solver's strict mode May 26, 2024
@Ketasaja Ketasaja changed the title any as generic T incompatible with {any} as generic {T} in new type solver's strict mode any as generic T incompatible with {T} in new type solver's strict mode May 26, 2024
@Ketasaja Ketasaja reopened this May 26, 2024
@alexmccord alexmccord added the new solver This issue is specific to the new solver. label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new solver This issue is specific to the new solver.
Development

No branches or pull requests

2 participants