Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow duplicate free variables in defs (#11965)
Makes the following a syntax error: ```crystal def foo(x : T) forall T, T # Error: duplicated free variable name: T end ``` Currently the two `T`s are indistinguishable, but if something like #11908 is eventually implemented, the same free variable might be bounded in one place but not another (`T <= Int32, T`), or it might have two different bounds (`T <= Int32, T <= String`). This PR ensures every name to the right of `forall` defines a distinct free variable.
- Loading branch information