Fix a type judgement that we wouldn't actually be able to make with this design.

This commit is contained in:
Andy Friesen 2022-03-29 10:59:43 -07:00
parent 96449acecb
commit 17c418adce

View file

@ -45,7 +45,7 @@ end
There is nothing wrong with the implementation of `foo` here, but Luau fails to typecheck it all the same because `f` is used in an inconsistent way. This too can be worked around by introducing a type annotation for `f`.
We would like to infer `f : <T...>((number) -> T... & (string) -> T...) -> ()`
The fact that the return type of `f` is never used confounds things a little, but for now it would be a big improvement if we inferred `f : <T...>((number | string) -> T...) -> ()`.
## Design