We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ffa984 commit b456c1bCopy full SHA for b456c1b
compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala
@@ -1605,4 +1605,23 @@ class ErrorMessagesTests extends ErrorMessagesTest {
1605
message.msg
1606
)
1607
}
1608
+
1609
+ @Test def StableIdentifiers() =
1610
+ checkMessagesAfter(FrontEnd.name) {
1611
+ """
1612
+ | object Test {
1613
+ | var x = 2
1614
+ | def test = 2 match {
1615
+ | case `x` => x + 1
1616
+ | }
1617
1618
+ """.stripMargin
1619
+ }.expect { (_, messages) =>
1620
+ assertMessageCount(1, messages)
1621
+ val message = message.head
1622
+ assertTrue(message.isInstanceOf[StableIdentPattern])
1623
+ assertEquals(
1624
+ "Stable identifier required, but `x` found"
1625
+ )
1626
+ }
1627
0 commit comments