diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-20 10:54:25 +0100 |
---|---|---|
committer | Tobias Schlatter <tobias@meisch.ch> | 2014-03-21 11:28:30 +0100 |
commit | 72a5f392bf11b6474b351cd81a17d0ceeed13dcc (patch) | |
tree | 852be17c2bf42d380eb8078823bca2bfe60b0ccc /tests/neg | |
parent | 07939c96715cd5adf7f220d239f61b73dd00edc3 (diff) | |
download | dotty-72a5f392bf11b6474b351cd81a17d0ceeed13dcc.tar.gz dotty-72a5f392bf11b6474b351cd81a17d0ceeed13dcc.tar.bz2 dotty-72a5f392bf11b6474b351cd81a17d0ceeed13dcc.zip |
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.
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/t0273.scala | 7 |
1 files changed, 7 insertions, 0 deletions
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]) = () +} |