-
Notifications
You must be signed in to change notification settings - Fork 379
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
Incorrect type widening with multiple arguments to generic T
with new solver
#1293
Comments
I'm not sure that I'd necessarily call this a bug. There does exist a type to provide for |
You're right, I don't have label changing permissions though. My usecase is that the ECS library I use has The advantage over function overloads is that there's no need to define components upfront, which makes it easy for other libraries to define them. Maybe if other users have similar usecases it could be worth considering delaying this inference change in strict mode if generic constraints are a long way away? |
More common example: --!strict
local t: {string} = {}
table.insert(t, 1) |
I don't think there's an immediately obvious way for us to "delay" this change, but if the type of one of the fields is already required to be some particular type (e.g. in that |
T
with new solverT
T
T
with new solver
Tested on v0.629, with no errors in strict or non-strict mode:
The text was updated successfully, but these errors were encountered: