summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-04-09 09:51:00 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-04-09 09:51:00 +0000
commit3cc8af6179ac7b1778c19d96bfacd01120407d26 (patch)
treefeeee3d60e12ff29a9c408a2746c3d460968a81b /src
parent82deaa1e794fbdadf2c60f206966797bcd9f9ca1 (diff)
downloadscala-3cc8af6179ac7b1778c19d96bfacd01120407d26.tar.gz
scala-3cc8af6179ac7b1778c19d96bfacd01120407d26.tar.bz2
scala-3cc8af6179ac7b1778c19d96bfacd01120407d26.zip
close #3207. review by odersky
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
index b5c5bc95ae..89b4f910e5 100644
--- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
@@ -210,8 +210,11 @@ trait NamesDefaults { self: Analyzer =>
blockWithoutQualifier(defaultQual)
// super constructor calls
- case Select(Super(_, _), _) if isConstr =>
- val defaultQual = moduleQual(baseFun.pos, mod => gen.mkAttributedRef(mod))
+ case Select(sp @ Super(_, _), _) if isConstr =>
+ // fix for #3207. selection of the companion module of the superclass
+ // needs to have the same prefix as the the superclass.
+ val superprefix = sp.symbol.tpe.parents.head.prefix
+ val defaultQual = moduleQual(baseFun.pos, mod => gen.mkAttributedRef(superprefix, mod))
blockWithoutQualifier(defaultQual)
// self constructor calls (in secondary constructors)
@@ -377,7 +380,8 @@ trait NamesDefaults { self: Analyzer =>
} else {
val defGetterName = param.owner.name +"$default$"+ i
if (param.owner.owner.isClass) {
- param.owner.owner.info.member(defGetterName)
+ // .toInterface: otherwise we get the method symbol of the impl class
+ param.owner.owner.toInterface.info.member(defGetterName)
} else {
// the owner of the method is another method. find the default
// getter in the context.