Skip to content

Commit

Permalink
Merge pull request #4959 from dotty-staging/fix-#1731
Browse files Browse the repository at this point in the history
Fix #1731: Add regression test
  • Loading branch information
nicolasstucki committed Aug 17, 2018
2 parents 788908f + a1b4641 commit e8f137c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,21 @@ class ErrorMessagesTests extends ErrorMessagesTest {
assertEquals("foo", cycleSym.name.show)
}

@Test def i1731 =
checkMessagesAfter(FrontEnd.name) {
"""
|case class Foo[T](x: T)
|object Foo { def apply[T]() = Foo(null.asInstanceOf[T]) }
""".stripMargin
}
.expect { (ictx, messages) =>
implicit val ctx: Context = ictx

assertMessageCount(1, messages)
val OverloadedOrRecursiveMethodNeedsResultType(cycleSym) :: Nil = messages
assertEquals("apply", cycleSym.name.show)
}

@Test def recursiveMethodNeedsReturnType =
checkMessagesAfter(FrontEnd.name) {
"""
Expand Down

0 comments on commit e8f137c

Please sign in to comment.