From 901271dfeb11c3e6f65e3c7d8843659a1df98538 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 7 Feb 2020 12:23:57 +0100 Subject: [PATCH] Update message for erased function types --- .../dotty/tools/dotc/reporting/diagnostic/messages.scala | 6 +++--- .../dotty/tools/dotc/reporting/ErrorMessagesTests.scala | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala index 22fd2b9f89c6..b1a0b3dfad39 100644 --- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala @@ -2383,17 +2383,17 @@ object messages { val explanation: String = "" } - case class ImplicitTypesCanOnlyBeFunctionTypes()(implicit val ctx: Context) + case class ImplicitTypesCanOnlyBeFunctionTypes()(implicit val ctx: Context) // TODO remove when (given ...) => is removed extends Message(ImplicitTypesCanOnlyBeFunctionTypesID) { val kind: String = "Syntax" - val msg: String = "Types with given keyword can only be function types `given (...) => ...`" + val msg: String = "Types with given keyword can only be function types `(given ...) => ...`" val explanation: String = "" } case class ErasedTypesCanOnlyBeFunctionTypes()(implicit val ctx: Context) extends Message(ErasedTypesCanOnlyBeFunctionTypesID) { val kind: String = "Syntax" - val msg: String = "Types with erased keyword can only be function types `erased (...) => ...`" + val msg: String = "Types with erased keyword can only be function types `(erased ...) => ...`" val explanation: String = "" } diff --git a/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala b/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala index bf97994f1170..23fcf38342c4 100644 --- a/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala +++ b/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala @@ -1699,7 +1699,7 @@ class ErrorMessagesTests extends ErrorMessagesTest { implicit val ctx: Context = ictx assertMessageCount(1, messages) val ImplicitTypesCanOnlyBeFunctionTypes() :: Nil = messages - assertEquals("Types with given keyword can only be function types `given (...) => ...`", messages.head.msg) + assertEquals("Types with given keyword can only be function types `(given ...) => ...`", messages.head.msg) } @Test def erasedTypesCanOnlyBeFunctionTypesFailed() = @@ -1708,7 +1708,7 @@ class ErrorMessagesTests extends ErrorMessagesTest { implicit val ctx: Context = ictx assertMessageCount(1, messages) val ErasedTypesCanOnlyBeFunctionTypes() :: Nil = messages - assertEquals("Types with erased keyword can only be function types `erased (...) => ...`", messages.head.msg) + assertEquals("Types with erased keyword can only be function types `(erased ...) => ...`", messages.head.msg) } @Test def caseClassMissingParamListSuccessful =