aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-06 09:46:07 +0100
committerMartin Odersky <odersky@gmail.com>2014-03-07 11:12:33 +0100
commit5b30038dd3561468a8f4a9a9f50e1a0208062de1 (patch)
tree70433caeada230d4e87c13b91f7644a0bbb910ba /src/dotty/tools/dotc/typer/Typer.scala
parentccb4f8afb7af71364c1b3d0f6565d686155a8e66 (diff)
downloaddotty-5b30038dd3561468a8f4a9a9f50e1a0208062de1.tar.gz
dotty-5b30038dd3561468a8f4a9a9f50e1a0208062de1.tar.bz2
dotty-5b30038dd3561468a8f4a9a9f50e1a0208062de1.zip
Fix problem comparing overloaded TermRefs
Overloaded TermRefs do not have an info, and consequently do not support =:=. Yet in Typer#checkNewOrShadowed we compared termrefs with =:=. This gives an exception if the termrefs are overloaded. The fix is to provide a new method isSameRef in TypeComparer which is called instead of =:= in Typer#checkNewOrShadowed.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index e6f566193..aabcde94d 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -244,7 +244,7 @@ class Typer extends Namer with Applications with Implicits {
* does properly shadow the new one from an outer context.
*/
def checkNewOrShadowed(found: Type, newPrec: Int): Type =
- if (!previous.exists || (previous =:= found)) found
+ if (!previous.exists || ctx.typeComparer.isSameRef(previous, found)) found
else if ((prevCtx.scope eq ctx.scope) &&
(newPrec == definition ||
newPrec == namedImport && prevPrec == wildImport)) {