From 72a5f392bf11b6474b351cd81a17d0ceeed13dcc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 20 Mar 2014 10:54:25 +0100 Subject: Reverting decision what constitutes a double def. test case t0273. Was positive in Scala 2, is now deemed to be negative. Two two definitions def a = () => () def a[T] = (p:A) => () do have matching signatures, so should constitute a double definition. I previously thought that we can get away if the two definitions have different result types, but then you immediately have a problem because the denotations have matching signatures for the pruposes of "&" yet cannot be merged. Which of the two definitions would override a definition in a base class is then an arbitrary decision. --- tests/neg/t0273.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/neg/t0273.scala (limited to 'tests/neg') diff --git a/tests/neg/t0273.scala b/tests/neg/t0273.scala new file mode 100644 index 000000000..10f426828 --- /dev/null +++ b/tests/neg/t0273.scala @@ -0,0 +1,7 @@ +class A + +object Test { +def a = () => () +def a[T] = (p:A) => () +def main(args: Array[String]) = () +} -- cgit v1.2.3