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 /src/dotty/tools/dotc/typer | |
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 'src/dotty/tools/dotc/typer')
-rw-r--r-- | src/dotty/tools/dotc/typer/Checking.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala index a81e4079a..36822cb85 100644 --- a/src/dotty/tools/dotc/typer/Checking.scala +++ b/src/dotty/tools/dotc/typer/Checking.scala @@ -124,7 +124,7 @@ trait Checking extends NoChecking { for (decl <- cls.info.decls) { for (other <- seen(decl.name)) { typr.println(i"conflict? $decl $other") - if (decl.signature == other.signature) { + if (decl.signature matches other.signature) { def doubleDefError(decl: Symbol, other: Symbol): Unit = { def ofType = if (decl.isType) "" else i": ${other.info}" def explanation = |