diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2009-02-19 22:47:04 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2009-02-19 22:47:04 +0000 |
commit | 275e9c737537f12a3488dfd64ee84e6e7fae6ffe (patch) | |
tree | 8d053c2e09a181a1adbb0fcedd9d488a479cecce | |
parent | 6ed49d8b851f8f0138db46157cd09f27b217ee1f (diff) | |
download | scala-275e9c737537f12a3488dfd64ee84e6e7fae6ffe.tar.gz scala-275e9c737537f12a3488dfd64ee84e6e7fae6ffe.tar.bz2 scala-275e9c737537f12a3488dfd64ee84e6e7fae6ffe.zip |
Fix and test for #1659
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 4 | ||||
-rw-r--r-- | test/files/neg/t1659.check | 5 | ||||
-rw-r--r-- | test/files/neg/t1659.scala | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index aa842ce9bb..f07454dc76 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -3483,10 +3483,10 @@ A type's typeSymbol should never be inspected directly. var e1 = s1.lookupEntry(sym2.name) (e1 ne null) && { val substSym = sym2.info.substThis(sym2.owner, e1.sym.owner.thisType) - var isEqual = e1.sym.info =:= substSym + var isEqual = false while (!isEqual && (e1 ne null)) { - e1 = s1.lookupNextEntry(e1) isEqual = e1.sym.info =:= substSym + e1 = s1.lookupNextEntry(e1) } isEqual } diff --git a/test/files/neg/t1659.check b/test/files/neg/t1659.check new file mode 100644 index 0000000000..b4b3e8605e --- /dev/null +++ b/test/files/neg/t1659.check @@ -0,0 +1,5 @@ +t1659.scala:3: error: overriding method u in trait W of type [A](Y{type X = A})Unit; + method u has incompatible type +class Z extends W { def u[A](v : Y { type X = A }) = null } + ^ +one error found diff --git a/test/files/neg/t1659.scala b/test/files/neg/t1659.scala new file mode 100644 index 0000000000..10470d66f8 --- /dev/null +++ b/test/files/neg/t1659.scala @@ -0,0 +1,4 @@ +trait Y { type X } +trait W { def u[A](v : Y { type X = A }) : Unit } +class Z extends W { def u[A](v : Y { type X = A }) = null } + |