File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/dotty/tools/dotc/reporting/diagnostic
test/dotty/tools/dotc/reporting Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1842,7 +1842,9 @@ object messages {
1842
1842
case class OnlyFunctionsCanBeFollowedByUnderscore (pt : Type )(implicit ctx : Context )
1843
1843
extends Message (OnlyFunctionsCanBeFollowedByUnderscoreID ) {
1844
1844
val kind = " Syntax"
1845
- val msg = hl " not a function: $pt; cannot be followed by `_' "
1846
- val explanation = " "
1845
+ val msg = hl " Not a function: $pt: cannot be followed by ${" _" }"
1846
+ val explanation =
1847
+ hl """ The syntax ${" x _" } is no longer supported if ${" x" } is not a function.
1848
+ |To convert to a function value, you need to explicitly write ${" () => x" }"""
1847
1849
}
1848
1850
}
Original file line number Diff line number Diff line change @@ -1066,9 +1066,7 @@ class ErrorMessagesTests extends ErrorMessagesTest {
1066
1066
implicit val ctx : Context = ictx
1067
1067
1068
1068
assertMessageCount(1 , messages)
1069
-
1070
1069
val OnlyFunctionsCanBeFollowedByUnderscore (pt) :: Nil = messages
1071
-
1072
1070
assertEquals(" String(n)" , pt.show)
1073
1071
}
1074
1072
}
You can’t perform that action at this time.
0 commit comments