Skip to content

Commit 435fc82

Browse files
Merge pull request #12615 from dotty-staging/fix-12583
Fix implicit ValueOf synthesis
2 parents 54929c2 + 4de7351 commit 435fc82

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
@@ -162,7 +162,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
162162
New(defn.ValueOfClass.typeRef.appliedTo(t.tpe), t :: Nil).withSpan(span)
163163
formal.argInfos match
164164
case arg :: Nil =>
165-
fullyDefinedType(arg.dealias, "ValueOf argument", span).normalized match
165+
fullyDefinedType(arg, "ValueOf argument", span).normalized.dealias match
166166
case ConstantType(c: Constant) =>
167167
success(Literal(c))
168168
case tp: TypeRef if tp.isRef(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)