Skip to content

Commit 75a0ccb

Browse files
committed
Fix scala#9150: Dealias referecne to sigleton
1 parent 3c56b3e commit 75a0ccb

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(using Context) {
679679
val inlinedCtx = ctx.withSource(inlinedMethod.topLevelClass.source)
680680
paramProxy.get(tree.tpe) match {
681681
case Some(t) if tree.isTerm && t.isSingleton =>
682-
val inlinedSingleton = singleton(t).withSpan(argSpan)
682+
val inlinedSingleton = singleton(t.dealias).withSpan(argSpan)
683683
inlinedFromOutside(inlinedSingleton)(tree.span)
684684
case Some(t) if tree.isType =>
685685
TypeTree(t).withSpan(argSpan)

tests/pos/i9150-a.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import scala.compiletime.erasedValue
2+
3+
inline def fooErased[T] = inline erasedValue[T] match { case _ => }
4+
val f = fooErased[EmptyTuple]

tests/pos/i9150-b.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import scala.compiletime.erasedValue
2+
3+
type Foo = Foo.type
4+
object Foo
5+
6+
inline def fooErased[T] = inline erasedValue[T] match { case _ => }
7+
val f = fooErased[Foo]

0 commit comments

Comments
 (0)