diff --git a/compiler/src/dotty/tools/dotc/report.scala b/compiler/src/dotty/tools/dotc/report.scala index 479e8f0af253..54dc70caf41c 100644 --- a/compiler/src/dotty/tools/dotc/report.scala +++ b/compiler/src/dotty/tools/dotc/report.scala @@ -93,7 +93,7 @@ object report: */ def log(msg: => String, pos: SourcePosition = NoSourcePosition)(using Context): Unit = if (ctx.settings.Ylog.value.containsPhase(ctx.phase)) - echo(s"[log $ctx.phase] $msg", pos) + echo(s"[log ${ctx.phase}] $msg", pos) def debuglog(msg: => String)(using Context): Unit = if (ctx.debug) log(msg) diff --git a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala index fcce4bb9a45e..0d309c42cad1 100644 --- a/compiler/src/dotty/tools/dotc/typer/Dynamic.scala +++ b/compiler/src/dotty/tools/dotc/typer/Dynamic.scala @@ -168,7 +168,7 @@ trait Dynamic { val scall = if (vargss.isEmpty) base - else untpd.Apply(base, vargss.flatten) + else untpd.Apply(base, vargss.flatten.map(untpd.TypedSplice(_))) // If function is an `applyDynamic` that takes a ClassTag* parameter, // add `ctags`. diff --git a/tests/run/i9404.scala b/tests/run/i9404.scala new file mode 100644 index 000000000000..aa58e8760858 --- /dev/null +++ b/tests/run/i9404.scala @@ -0,0 +1,29 @@ +import scala.reflect.Selectable.reflectiveSelectable + +object Test { + def main(args: Array[String]): Unit = { + class Foo { + def makeInt: Int = 5 + def testInt(x: Int): Unit = assert(5 == x) + + def makeRef: Option[String] = Some("hi") + def testRef(x: Option[String]): Unit = assert(Some("hi") == x) + } + + def test(foo: { + def makeInt: Int + def testInt(x: Int): Unit + def makeRef: Option[String] + def testRef(x: Option[String]): Unit + }): Unit = { + foo.testInt(foo.makeInt) + // ^ + // cannot infer type; expected type is not fully defined + foo.testRef(foo.makeRef) + // ^ + // cannot infer type; expected type is not fully defined + } + + test(new Foo) + } +} \ No newline at end of file