-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Rework type inference #4080
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
Rework type inference #4080
Changes from 1 commit
90a661b
860d102
0ff0189
086f33d
8a19054
06fd9aa
2b6ce9c
e3d5a7f
93a0bca
1215dd2
c460627
59bb75b
a800a10
d17cab4
417f0c8
a6e1d19
95f8a84
c810d5a
855e0e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -675,14 +675,16 @@ object Erasure { | |
super.typedStats(stats1, exprOwner).filter(!_.isEmpty) | ||
} | ||
|
||
override def adapt(tree: Tree, pt: Type)(implicit ctx: Context): Tree = | ||
override def adapt(tree: Tree, pt: Type, locked: TypeVars)(implicit ctx: Context): Tree = | ||
trace(i"adapting ${tree.showSummary}: ${tree.tpe} to $pt", show = true) { | ||
assert(ctx.phase == ctx.erasurePhase.next, ctx.phase) | ||
assert(ctx.phase == ctx.erasurePhase || ctx.phase == ctx.erasurePhase.next, ctx.phase) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why. Some transform ran at phase erasure and used the erasure typer to do it. Seems legit. Not sure why it did not run before. |
||
if (tree.isEmpty) tree | ||
else if (ctx.mode is Mode.Pattern) tree // TODO: replace with assertion once pattern matcher is active | ||
else adaptToType(tree, pt) | ||
} | ||
} | ||
|
||
override def simplify(tree: Tree, pt: Type, locked: TypeVars)(implicit ctx: Context): tree.type = tree | ||
} | ||
|
||
def takesBridges(sym: Symbol)(implicit ctx: Context) = | ||
sym.isClass && !sym.is(Flags.Trait | Flags.Package) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: varibles -> variables