From 987e381c3fd4c45d966d03f50328289d219c38ae Mon Sep 17 00:00:00 2001 From: Aleksander Rainko Date: Mon, 5 Aug 2024 21:13:40 +0200 Subject: [PATCH] add a test for the new error message [Cherry-picked ffac87d3e9429cbe43e9363cc779c92547534cc1] --- tests/neg/i15987.check | 5 +++++ tests/neg/{i15987/DerivedIssue.scala => i15987.scala} | 2 -- tests/neg/i15987/DerivedIssue.check | 4 ---- 3 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 tests/neg/i15987.check rename tests/neg/{i15987/DerivedIssue.scala => i15987.scala} (93%) delete mode 100644 tests/neg/i15987/DerivedIssue.check diff --git a/tests/neg/i15987.check b/tests/neg/i15987.check new file mode 100644 index 000000000000..b62c8cac160b --- /dev/null +++ b/tests/neg/i15987.check @@ -0,0 +1,5 @@ +-- Error: tests/neg/i15987.scala:26:40 --------------------------------------------------------------------------------- +26 |case class Person(name: String) derives ShowWithExplicit, // error + | ^ + | derived instance ShowWithExplicit[Person] failed to generate: + | method `derived` from object ShowWithExplicit takes explicit term parameters diff --git a/tests/neg/i15987/DerivedIssue.scala b/tests/neg/i15987.scala similarity index 93% rename from tests/neg/i15987/DerivedIssue.scala rename to tests/neg/i15987.scala index 3da8b7765607..743f5f7ccda0 100644 --- a/tests/neg/i15987/DerivedIssue.scala +++ b/tests/neg/i15987.scala @@ -1,5 +1,3 @@ -import scala.language.experimental.clauseInterleaving - trait ShowWithExplicit[A] object ShowWithExplicit: diff --git a/tests/neg/i15987/DerivedIssue.check b/tests/neg/i15987/DerivedIssue.check deleted file mode 100644 index f1254c1c6f57..000000000000 --- a/tests/neg/i15987/DerivedIssue.check +++ /dev/null @@ -1,4 +0,0 @@ --- Error: tests/neg/7722.scala:2:40 ------------------------------------------------------------------------------------ -2 | @scala.annotation.targetName("E") def this() = this(3) // error - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | @targetName annotation may not be used on a constructor