-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes for Metals infer expected type feature
Fixes to makeVarArg and assignType(SeqLiteral) fixes the propagation of vararg type errors, which would trip up InferExpectedType's looking at whether the tree's type are errors. Force LazyRef in AvoidWildcardsMap to avoid unneeded new LazyRef's. LazyRefs, which are created for recursive types, aren't cacheable, so if you TypeMap an AppliedType with one, it will create a brand new instance. OrderingConstraint#init runs AvoidWildcardsMap on param bounds. So when instDirection compares the constraint bounds and the original param bounds (to calculate the instantiate direction), because they are new instances they won't shortcircuit, leading to a recursion overflow. By forcing, it will eq check and return true. Finally, change interpolateTypeVars' instantiation decision, following the logic that isFullyDefined had. In particular, if the typevar has an upper bound constraint, maximise rather than minimise, which fixes the inference of map/flatMap's B type args. Finally, drop needless tree.tpe.isInstanceOf[MethodOrPoly] and tree.tpe.widen in interpolateTypeVars.
- Loading branch information
Showing
8 changed files
with
87 additions
and
87 deletions.
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
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
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
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
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