Skip to content

Commit bc6ac51

Browse files
committed
add error messages
1 parent 606323b commit bc6ac51

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,5 +1023,21 @@ class ErrorMessagesTests extends ErrorMessagesTest {
10231023
assertMessageCount(1, messages)
10241024
val EnumCaseDefinitionInNonEnumOwner(owner) :: Nil = messages
10251025
assertEquals("object Qux", owner.show)
1026+
1027+
@Test def tailrecNotApplicableNeitherPrivateNorFinal =
1028+
checkMessagesAfter("tailrec") {
1029+
"""
1030+
|class Foo {
1031+
|
1032+
| @scala.annotation.tailrec
1033+
| def foo: Unit = foo
1034+
|
1035+
|}
1036+
""".stripMargin
1037+
}.expect { (ictx, messages) =>
1038+
implicit val ctx: Context = ictx
1039+
assertMessageCount(1, messages)
1040+
val TailrecNotApplicableNeitherPrivateNorFinal(symbol) :: Nil = messages
1041+
assertEquals(symbol.show, "method foo")
10261042
}
10271043
}

0 commit comments

Comments
 (0)