diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala index 4822be59b57f..1a62b6b1f62d 100644 --- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala @@ -189,12 +189,15 @@ object messages { val msg = { val ofFun = if (MethodType.syntheticParamNames(args.length + 1) contains param.name) - i" of expanded function $tree" + i" of expanded function:\n$tree" else "" - i"""missing parameter type for parameter ${param.name}$ofFun, expected = $pt - |The argument types of an anonymous function must be fully known. (SLS 8.5)""" + i"""missing parameter type + | + |The argument types of an anonymous function must be fully known. (SLS 8.5) + |Expected type: $pt + |Missing type for parameter ${param.name}$ofFun""" } val explanation = diff --git a/compiler/test-resources/repl/errorThenValid b/compiler/test-resources/repl/errorThenValid index 832c3334f9ca..030d06caba39 100644 --- a/compiler/test-resources/repl/errorThenValid +++ b/compiler/test-resources/repl/errorThenValid @@ -1,7 +1,10 @@ scala> val xs = scala.collection.mutable.ListBuffer[Int] 1 | val xs = scala.collection.mutable.ListBuffer[Int] | ^ - |missing parameter type for parameter elems, expected = ? + |missing parameter type + | |The argument types of an anonymous function must be fully known. (SLS 8.5) + |Expected type: ? + |Missing type for parameter elems scala> val xs = scala.collection.mutable.ListBuffer[Int]() val xs: scala.collection.mutable.ListBuffer[Int] = ListBuffer()