-
-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compiler crash related to type parameter references
This fixes a bug in rescoping. Rescoping happens after a method was copied from a trait/interface to another type. It starts with a fresh scope, visits all of the method's AST nodes and adds the visited symbols to the method's symbol table. This includes type parameters. If a type parameter reference is visited, the referenced type parameter is looked up and added as data to the node. As rescoping starts with a fresh scope, adding the type parameter to the reference fails if the type parameter itself is not defined yet. This is fixed by eagerly adding type parameters to the scope before visiting type parameter references. Fixes #3285
- Loading branch information
1 parent
22df673
commit 57cc552
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Fix compiler crash related to type parameter references | ||
|
||
Previously, if a method signature in a trait or interface referenced a type | ||
parameter before the type parameter itself was defined, the compiler would | ||
crash. This is now fixed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters