Skip to content

Commit 17019df

Browse files
committed
Also strip of AppliedTermRef in Type.widenTermRefExpr.
1 parent 6211f07 commit 17019df

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ object Types {
934934
*/
935935
final def widenTermRefExpr(implicit ctx: Context): Type = stripTypeVar match {
936936
case tp: TermRef if !tp.isOverloaded => tp.underlying.widenExpr.widenTermRefExpr
937+
case tp: AppliedTermRef => tp.underlying.widenExpr.widenTermRefExpr
937938
case _ => this
938939
}
939940

@@ -2172,8 +2173,11 @@ object Types {
21722173
def apply(fn: Type, args: List[Type])(implicit ctx: Context): Type = {
21732174
assertUnerased()
21742175
fn.dealias match {
2175-
case fn: TermRef => unique(new CachedAppliedTermRef(fn, args))
2176-
case fn: AppliedTermRef => unique(new CachedAppliedTermRef(fn, args))
2176+
case fn: TermRef =>
2177+
assert(!fn.isOverloaded)
2178+
unique(new CachedAppliedTermRef(fn, args))
2179+
case fn: AppliedTermRef =>
2180+
unique(new CachedAppliedTermRef(fn, args))
21772181
case _ =>
21782182
fn.widenDealias match {
21792183
case methTpe: MethodType => ctx.typer.applicationResultType(methTpe, args) // TODO(gsps): Check length?

0 commit comments

Comments
 (0)