Skip to content

Commit 4de7351

Browse files
committed
Fix implicit ValueOf synthesis
Foxes #12583
1 parent 89e57aa commit 4de7351

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
163163

164164
formal.argInfos match
165165
case arg :: Nil =>
166-
fullyDefinedType(arg.dealias, "ValueOf argument", span).normalized match
166+
fullyDefinedType(arg, "ValueOf argument", span).normalized.dealias match
167167
case ConstantType(c: Constant) =>
168168
success(Literal(c))
169169
case TypeRef(_, sym) if sym == defn.UnitClass =>

tests/pos/i12583.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
case class Wrapper[A <: Singleton](a: A)(using ValueOf[A])
2+
3+
def test[A <: Singleton](blabla: Wrapper[A]): Unit = ()
4+
5+
val _ = test(Wrapper("yo"))

0 commit comments

Comments
 (0)