Skip to content

Commit 0bdbc87

Browse files
committed
Change underlying to superType in TypeEval
1 parent 6fa4767 commit 0bdbc87

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ object TypeEval:
1818
// final val one = 1
1919
// type Two = one.type + one.type
2020
// ```
21-
case tp: TypeProxy if tp.underlying.isStable => tp.underlying.fixForEvaluation
21+
case tp: TypeProxy =>
22+
val tp1 = tp.superType
23+
if tp1.isStable then tp1.fixForEvaluation else tp
2224
case tp => tp
2325

2426
def constValue(tp: Type): Option[Any] = tp.fixForEvaluation match

compiler/src/dotty/tools/dotc/typer/Deriving.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ trait Deriving {
3333
case tp: TypeRef if tp.symbol.isClass => tp
3434
case tp: TypeRef if tp.symbol.isAbstractType => NoType
3535
case tp: TermRef => NoType
36-
case tp: TypeProxy => underlyingClassRef(tp.underlying)
36+
case tp: TypeProxy => underlyingClassRef(tp.superType)
3737
case _ => NoType
3838
}
3939

0 commit comments

Comments
 (0)