Skip to content

Commit 9a0199d

Browse files
committed
WIP widen 4
1 parent 946c7be commit 9a0199d

15 files changed

+66
-66
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
322322
val env: List[Tree] = app.env
323323
val call: Tree = app.meth
324324
val functionalInterface: Symbol = {
325-
val t = app.tpt.tpe.typeSymbol
325+
val t = app.tpt.tpe.widen.typeSymbol
326326
if (t.exists) t
327327
else {
328328
val arity = app.meth.tpe.widenDealias.firstParamTypes.size - env.size
@@ -1357,7 +1357,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
13571357
* not using the rich equality is possible (their own equals method will do ok.)
13581358
*/
13591359
val mustUseAnyComparator: Boolean = {
1360-
val areSameFinals = l.tpe.typeSymbol.is(Final) && r.tpe.typeSymbol.is(Final) && (l.tpe =:= r.tpe)
1360+
val areSameFinals = l.tpe.widen.typeSymbol.is(Final) && r.tpe.widen.typeSymbol.is(Final) && (l.tpe =:= r.tpe)
13611361
// todo: remove
13621362
def isMaybeBoxed(sym: Symbol): Boolean = {
13631363
(sym == defn.ObjectClass) ||

compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
443443
}
444444

445445
private def isRuntimeVisible(annot: Annotation): Boolean =
446-
if (toDenot(annot.tree.tpe.typeSymbol).hasAnnotation(AnnotationRetentionAttr))
446+
if (toDenot(annot.tree.tpe.widen.typeSymbol).hasAnnotation(AnnotationRetentionAttr))
447447
retentionPolicyOf(annot) == AnnotationRetentionRuntimeAttr
448448
else {
449449
// SI-8926: if the annotation class symbol doesn't have a @RetentionPolicy annotation, the
@@ -453,7 +453,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
453453
}
454454

455455
private def retentionPolicyOf(annot: Annotation): Symbol =
456-
annot.tree.tpe.typeSymbol.getAnnotation(AnnotationRetentionAttr).
456+
annot.tree.tpe.widen.typeSymbol.getAnnotation(AnnotationRetentionAttr).
457457
flatMap(_.argumentConstant(0).map(_.symbolValue)).getOrElse(AnnotationRetentionClassAttr)
458458

459459
private def assocsFromApply(tree: Tree): List[(Name, Tree)] = {
@@ -730,7 +730,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
730730
*/
731731
def isAndroidParcelableClass(sym: Symbol) =
732732
(AndroidParcelableInterface != NoSymbol) &&
733-
(sym.info.parents.map(_.typeSymbol) contains AndroidParcelableInterface)
733+
(sym.info.parents.map(_.widen.typeSymbol) contains AndroidParcelableInterface)
734734

735735
/*
736736
* must-single-thread
@@ -854,7 +854,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
854854

855855
private def getGenericSignatureHelper(sym: Symbol, owner: Symbol, memberTpe: Type)(using Context): Option[String] = {
856856
if (needsGenericSignature(sym)) {
857-
val erasedTypeSym = TypeErasure.fullErasure(sym.denot.info).typeSymbol
857+
val erasedTypeSym = TypeErasure.fullErasure(sym.denot.info).widen.typeSymbol
858858
if (erasedTypeSym.isPrimitiveValueClass) {
859859
// Suppress signatures for symbols whose types erase in the end to primitive
860860
// value types. This is needed to fix #7416.

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,7 +2643,7 @@ class JSCodeGen()(using genCtx: Context) {
26432643
makePrimitiveBox(expr, tpe)
26442644

26452645
case tpe: ErasedValueType =>
2646-
val boxedClass = tpe.tycon.typeSymbol
2646+
val boxedClass = tpe.tycon.widen.typeSymbol
26472647
val ctor = boxedClass.primaryConstructor
26482648
js.New(encodeClassName(boxedClass), encodeMethodSym(ctor), List(expr))
26492649

@@ -2670,7 +2670,7 @@ class JSCodeGen()(using genCtx: Context) {
26702670
makePrimitiveUnbox(expr, tpe)
26712671

26722672
case tpe: ErasedValueType =>
2673-
val boxedClass = tpe.tycon.typeSymbol.asClass
2673+
val boxedClass = tpe.tycon.widen.typeSymbol.asClass
26742674
val unboxMethod = ValueClasses.valueClassUnbox(boxedClass)
26752675
val content = genApplyMethod(
26762676
js.AsInstanceOf(expr, encodeClassType(boxedClass)), unboxMethod, Nil)
@@ -2850,7 +2850,7 @@ class JSCodeGen()(using genCtx: Context) {
28502850
}
28512851
arg match {
28522852
case Literal(value) if value.tag == Constants.ClazzTag =>
2853-
val classSym = value.typeValue.typeSymbol
2853+
val classSym = value.typeValue.widen.typeSymbol
28542854
if (isJSType(classSym) && !classSym.is(Trait) && !classSym.is(ModuleClass))
28552855
classSym
28562856
else
@@ -3642,7 +3642,7 @@ class JSCodeGen()(using genCtx: Context) {
36423642
tpe.widenDealias match {
36433643
case JavaArrayType(_) => false
36443644
case _: ErasedValueType => false
3645-
case t => t.typeSymbol.asClass.isPrimitiveValueClass
3645+
case t => t.widen.typeSymbol.asClass.isPrimitiveValueClass
36463646
}
36473647
}
36483648

@@ -3659,7 +3659,7 @@ class JSCodeGen()(using genCtx: Context) {
36593659
}
36603660

36613661
private def isMaybeJavaScriptException(tpe: Type): Boolean =
3662-
jsdefn.JavaScriptExceptionClass.isSubClass(tpe.typeSymbol)
3662+
jsdefn.JavaScriptExceptionClass.isSubClass(tpe.widen.typeSymbol)
36633663

36643664
// Copied from DottyBackendInterface
36653665

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
488488

489489
/** new C(args), calling the primary constructor of C */
490490
def New(tp: Type, args: List[Tree])(using Context): Apply =
491-
New(tp, tp.dealias.typeSymbol.primaryConstructor.asTerm, args)
491+
New(tp, tp.dealias.widen.typeSymbol.primaryConstructor.asTerm, args)
492492

493493
/** new C(args), calling given constructor `constr` of C */
494494
def New(tp: Type, constr: TermSymbol, args: List[Tree])(using Context): Apply = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ object Annotations {
1212

1313
def annotClass(tree: Tree)(using Context) =
1414
if (tree.symbol.isConstructor) tree.symbol.owner
15-
else tree.tpe.typeSymbol
15+
else tree.tpe.widen.typeSymbol
1616

1717
abstract class Annotation {
1818
def tree(using Context): Tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ object Constants {
164164
}
165165
case pt => pt
166166
}
167-
val target = classBound(pt).typeSymbol
168-
if (target == tpe.typeSymbol)
167+
val target = classBound(pt).widen.typeSymbol
168+
if (target == tpe.widen.typeSymbol)
169169
this
170170
else if ((target == defn.ByteClass) && isByteRange)
171171
Constant(byteValue)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ trait ConstraintHandling {
315315

316316
def dropOneSuperTrait(tp: Type): Type =
317317
val tpd = tp.dealias
318-
if tpd.typeSymbol.isSuperTrait && !tpd.isLambdaSub && !kept.contains(tpd) then
318+
if tpd.widen.typeSymbol.isSuperTrait && !tpd.isLambdaSub && !kept.contains(tpd) then
319319
dropped = tpd :: dropped
320320
defn.AnyType
321321
else tpd match

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ class Definitions {
997997
def apply(args: List[Type], resultType: Type, isContextual: Boolean = false, isErased: Boolean = false)(using Context): Type =
998998
FunctionType(args.length, isContextual, isErased).appliedTo(args ::: resultType :: Nil)
999999
def unapply(ft: Type)(using Context): Option[(List[Type], Type, Boolean, Boolean)] = {
1000-
val tsym = ft.typeSymbol
1000+
val tsym = ft.widen.typeSymbol
10011001
if isFunctionClass(tsym) && ft.isRef(tsym) then
10021002
val targs = ft.dealias.argInfos
10031003
if (targs.isEmpty) None
@@ -1380,12 +1380,12 @@ class Definitions {
13801380
*/
13811381
def isNonRefinedFunction(tp: Type)(using Context): Boolean =
13821382
val arity = functionArity(tp)
1383-
val sym = tp.dealias.typeSymbol
1383+
val sym = tp.dealias.widen.typeSymbol
13841384

13851385
arity >= 0
13861386
&& isFunctionClass(sym)
13871387
&& tp.isRef(
1388-
FunctionType(arity, sym.name.isContextFunction, sym.name.isErasedFunction).typeSymbol,
1388+
FunctionType(arity, sym.name.isContextFunction, sym.name.isErasedFunction).widen.typeSymbol,
13891389
skipRefined = false)
13901390
end isNonRefinedFunction
13911391

@@ -1419,14 +1419,14 @@ class Definitions {
14191419
def isSpecializableFunction(cls: ClassSymbol, paramTypes: List[Type], retType: Type)(using Context): Boolean =
14201420
paramTypes.length <= 2 && cls.derivesFrom(FunctionClass(paramTypes.length)) && (paramTypes match {
14211421
case Nil =>
1422-
Function0SpecializedReturnClasses().contains(retType.typeSymbol)
1422+
Function0SpecializedReturnClasses().contains(retType.widen.typeSymbol)
14231423
case List(paramType0) =>
1424-
Function1SpecializedParamClasses().contains(paramType0.typeSymbol) &&
1425-
Function1SpecializedReturnClasses().contains(retType.typeSymbol)
1424+
Function1SpecializedParamClasses().contains(paramType0.widen.typeSymbol) &&
1425+
Function1SpecializedReturnClasses().contains(retType.widen.typeSymbol)
14261426
case List(paramType0, paramType1) =>
1427-
Function2SpecializedParamClasses().contains(paramType0.typeSymbol) &&
1428-
Function2SpecializedParamClasses().contains(paramType1.typeSymbol) &&
1429-
Function2SpecializedReturnClasses().contains(retType.typeSymbol)
1427+
Function2SpecializedParamClasses().contains(paramType0.widen.typeSymbol) &&
1428+
Function2SpecializedParamClasses().contains(paramType1.widen.typeSymbol) &&
1429+
Function2SpecializedReturnClasses().contains(retType.widen.typeSymbol)
14301430
case _ =>
14311431
false
14321432
})
@@ -1444,7 +1444,7 @@ class Definitions {
14441444
case tp1: TypeParamRef if ctx.typerState.constraint.contains(tp1) =>
14451445
asContextFunctionType(TypeComparer.bounds(tp1).hiBound)
14461446
case tp1 =>
1447-
if tp1.typeSymbol.name.isContextFunction && isFunctionType(tp1) then tp1
1447+
if tp1.widen.typeSymbol.name.isContextFunction && isFunctionType(tp1) then tp1
14481448
else NoType
14491449

14501450
/** Is `tp` an context function type? */
@@ -1463,11 +1463,11 @@ class Definitions {
14631463
val tp1 = asContextFunctionType(tp)
14641464
if tp1.exists then
14651465
val args = tp1.dropDependentRefinement.argInfos
1466-
Some((args.init, args.last, tp1.typeSymbol.name.isErasedFunction))
1466+
Some((args.init, args.last, tp1.widen.typeSymbol.name.isErasedFunction))
14671467
else None
14681468

14691469
def isErasedFunctionType(tp: Type)(using Context): Boolean =
1470-
tp.dealias.typeSymbol.name.isErasedFunction && isFunctionType(tp)
1470+
tp.dealias.widen.typeSymbol.name.isErasedFunction && isFunctionType(tp)
14711471

14721472
/** A whitelist of Scala-2 classes that are known to be pure */
14731473
def isAssuredNoInits(sym: Symbol): Boolean =
@@ -1484,7 +1484,7 @@ class Definitions {
14841484

14851485
/** If it is BoxedUnit, remove `java.io.Serializable` from `parents`. */
14861486
def adjustForBoxedUnit(cls: ClassSymbol, parents: List[Type]): List[Type] =
1487-
if (isBoxedUnitClass(cls)) parents.filter(_.typeSymbol != JavaSerializableClass)
1487+
if (isBoxedUnitClass(cls)) parents.filter(_.widen.typeSymbol != JavaSerializableClass)
14881488
else parents
14891489

14901490
private val HasProblematicGetClass: Set[Name] = Set(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ object SymDenotations {
19911991
def computeApplied = {
19921992
btrCache(tp) = NoPrefix
19931993
val baseTp =
1994-
if (tycon.typeSymbol eq symbol) tp
1994+
if (tycon.widen.typeSymbol eq symbol) tp
19951995
else (tycon.typeParams: @unchecked) match {
19961996
case LambdaParam(_, _) :: _ =>
19971997
recur(tp.superType)

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ object TypeApplications {
112112
}
113113

114114
def apply(t: Type): Type = t match {
115-
case t @ AppliedType(tycon, args1) if tycon.typeSymbol.isClass =>
115+
case t @ AppliedType(tycon, args1) if tycon.widen.typeSymbol.isClass =>
116116
t.derivedAppliedType(apply(tycon), args1.mapConserve(applyArg))
117117
case t @ RefinedType(parent, name, TypeAlias(info)) =>
118118
t.derivedRefinedType(apply(parent), name, applyArg(info).bounds)
@@ -164,7 +164,7 @@ class TypeApplications(val self: Type) extends AnyVal {
164164
case _ => self.info.typeParams
165165
}
166166
case self: AppliedType =>
167-
if (self.tycon.typeSymbol.isClass) Nil
167+
if (self.tycon.widen.typeSymbol.isClass) Nil
168168
else self.superType.typeParams
169169
case self: ClassInfo =>
170170
self.cls.typeParams
@@ -213,7 +213,7 @@ class TypeApplications(val self: Type) extends AnyVal {
213213
case self: TypeRef =>
214214
if (self.symbol == defn.AnyKindClass) self else self.info.hkResult
215215
case self: AppliedType =>
216-
if (self.tycon.typeSymbol.isClass) NoType else self.superType.hkResult
216+
if (self.tycon.widen.typeSymbol.isClass) NoType else self.superType.hkResult
217217
case self: HKTypeLambda => self.resultType
218218
case _: SingletonType | _: RefinedType | _: RecType => NoType
219219
case self: WildcardType => self.optBounds.hkResult
@@ -301,7 +301,7 @@ class TypeApplications(val self: Type) extends AnyVal {
301301
// See i2201*.scala for examples where more aggressive
302302
// reduction would break type inference.
303303
dealiased.paramRefs == dealiasedArgs ||
304-
defn.isCompiletimeAppliedType(tyconBody.typeSymbol)
304+
defn.isCompiletimeAppliedType(tyconBody.widen.typeSymbol)
305305
case _ => false
306306
}
307307
}
@@ -436,7 +436,7 @@ class TypeApplications(val self: Type) extends AnyVal {
436436
*/
437437
def translateJavaArrayElementType(using Context): Type =
438438
// A type parameter upper-bounded solely by `FromJavaObject` has `ObjectClass` as its classSymbol
439-
if self.typeSymbol.isAbstractOrParamType && (self.classSymbol eq defn.ObjectClass) then
439+
if self.widen.typeSymbol.isAbstractOrParamType && (self.classSymbol eq defn.ObjectClass) then
440440
AndType(self, defn.ObjectType)
441441
else
442442
self

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
425425
case None =>
426426

427427
def joinOK = tp2.dealiasKeepRefiningAnnots match {
428-
case tp2: AppliedType if !tp2.tycon.typeSymbol.isClass =>
428+
case tp2: AppliedType if !tp2.tycon.widen.typeSymbol.isClass =>
429429
// If we apply the default algorithm for `A[X] | B[Y] <: C[Z]` where `C` is a
430430
// type parameter, we will instantiate `C` to `A` and then fail when comparing
431431
// with `B[Y]`. To do the right thing, we need to instantiate `C` to the
@@ -500,7 +500,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
500500
else if (cls2.is(JavaDefined)) {
501501
// If `cls2` is parameterized, we are seeing a raw type, so we need to compare only the symbol
502502
val base = nonExprBaseType(tp1, cls2)
503-
if (base.typeSymbol == cls2) return true
503+
if (base.widen.typeSymbol == cls2) return true
504504
}
505505
else if tp1.isLambdaSub && !tp1.isAnyKind then
506506
return recur(tp1, EtaExpansion(tp2))
@@ -1171,7 +1171,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
11711171
* Delegates to compareS if `tycon` is scala.compiletime.S. Otherwise, constant folds if possible.
11721172
*/
11731173
def compareCompiletimeAppliedType(tp: AppliedType, other: Type, fromBelow: Boolean): Boolean = {
1174-
if (defn.isCompiletime_S(tp.tycon.typeSymbol)) compareS(tp, other, fromBelow)
1174+
if (defn.isCompiletime_S(tp.tycon.widen.typeSymbol)) compareS(tp, other, fromBelow)
11751175
else {
11761176
val folded = tp.tryCompiletimeConstantFold
11771177
if (fromBelow) recur(other, folded) else recur(folded, other)
@@ -2161,7 +2161,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
21612161
case tp1 @ AppliedType(tycon1, args1) =>
21622162
tp2 match {
21632163
case AppliedType(tycon2, args2)
2164-
if tycon1.typeSymbol == tycon2.typeSymbol && tycon1 =:= tycon2 =>
2164+
if tycon1.widen.typeSymbol == tycon2.widen.typeSymbol && tycon1 =:= tycon2 =>
21652165
val jointArgs = glbArgs(args1, args2, tycon1.typeParams)
21662166
if (jointArgs.forall(_.exists)) (tycon1 & tycon2).appliedTo(jointArgs)
21672167
else NoType

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,14 @@ object TypeErasure {
362362
tp2 match {
363363
case JavaArrayType(_) => tp2
364364
case _ =>
365-
val tsym1 = tp1.typeSymbol
366-
val tsym2 = tp2.typeSymbol
365+
val tsym1 = tp1.widen.typeSymbol
366+
val tsym2 = tp2.widen.typeSymbol
367367
if (!tsym2.exists) tp1
368368
else if (!tsym1.exists) tp2
369369
else if (!isJava && tsym1.derivesFrom(tsym2)) tp1
370370
else if (!isJava && tsym2.derivesFrom(tsym1)) tp2
371-
else if (tp1.typeSymbol.isRealClass) tp1
372-
else if (tp2.typeSymbol.isRealClass) tp2
371+
else if (tp1.widen.typeSymbol.isRealClass) tp1
372+
else if (tp2.widen.typeSymbol.isRealClass) tp2
373373
else tp1
374374
}
375375
}
@@ -459,7 +459,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
459459
SuperType(this(thistpe), this(supertpe))
460460
case ExprType(rt) =>
461461
defn.FunctionType(0)
462-
case RefinedType(parent, nme.apply, refinedInfo) if parent.typeSymbol eq defn.PolyFunctionClass =>
462+
case RefinedType(parent, nme.apply, refinedInfo) if parent.widen.typeSymbol eq defn.PolyFunctionClass =>
463463
assert(refinedInfo.isInstanceOf[PolyType])
464464
val res = refinedInfo.resultType
465465
val paramss = res.paramNamess
@@ -579,7 +579,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
579579
else if (isConstructor && isDerivedValueClass(sym)) eraseNormalClassRef(tp)
580580
else this(tp)
581581
case tp: AppliedType =>
582-
val sym = tp.tycon.typeSymbol
582+
val sym = tp.tycon.widen.typeSymbol
583583
if (sym.isClass && !erasureDependsOnArgs(sym)) eraseResult(tp.tycon)
584584
else this(tp)
585585
case _ =>
@@ -619,7 +619,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
619619
cls.fullName
620620
fullName.asTypeName
621621
case tp: AppliedType =>
622-
val sym = tp.tycon.typeSymbol
622+
val sym = tp.tycon.widen.typeSymbol
623623
sigName( // todo: what about repeatedParam?
624624
if (erasureDependsOnArgs(sym)) this(tp)
625625
else if (sym.isClass) tp.underlying
@@ -635,7 +635,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
635635
case tp: TypeVar =>
636636
val inst = tp.instanceOpt
637637
if (inst.exists) sigName(inst) else tpnme.Uninstantiated
638-
case tp @ RefinedType(parent, nme.apply, _) if parent.typeSymbol eq defn.PolyFunctionClass =>
638+
case tp @ RefinedType(parent, nme.apply, _) if parent.widen.typeSymbol eq defn.PolyFunctionClass =>
639639
// we need this case rather than falling through to the default
640640
// because RefinedTypes <: TypeProxy and it would be caught by
641641
// the case immediately below

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,8 @@ object TypeOps:
520520
*/
521521
def skolemizeWildcardArgs(tps: List[Type], app: Type) = app match {
522522
case AppliedType(tycon: TypeRef, args)
523-
if tycon.typeSymbol.isClass && !Feature.migrateTo3 =>
524-
tps.zipWithConserve(tycon.typeSymbol.typeParams) {
523+
if tycon.widen.typeSymbol.isClass && !Feature.migrateTo3 =>
524+
tps.zipWithConserve(tycon.widen.typeSymbol.typeParams) {
525525
(tp, tparam) => tp match {
526526
case _: TypeBounds => app.select(tparam)
527527
case _ => tp
@@ -543,7 +543,7 @@ object TypeOps:
543543
/** Is there a `LazyRef(TypeRef(_, sym))` reference in `tp`? */
544544
def isLazyIn(sym: Symbol, tp: Type): Boolean = {
545545
def isReference(tp: Type) = tp match {
546-
case tp: LazyRef => tp.ref.isInstanceOf[TypeRef] && tp.ref.typeSymbol == sym
546+
case tp: LazyRef => tp.ref.isInstanceOf[TypeRef] && tp.ref.widen.typeSymbol == sym
547547
case _ => false
548548
}
549549
tp.existsPart(isReference, forceLazy = false)

0 commit comments

Comments
 (0)