summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-09-24 17:27:20 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-09-24 17:27:20 +0000
commit6fea2488af12d942c1cf7ba781d2f60fe6ddc9c0 (patch)
tree8dfb5b1df353a5da15a92f8d5873f1617f800864 /src/compiler
parentfb38e47af1dec087a11585c6878c70ccdc930312 (diff)
downloadscala-6fea2488af12d942c1cf7ba781d2f60fe6ddc9c0.tar.gz
scala-6fea2488af12d942c1cf7ba781d2f60fe6ddc9c0.tar.bz2
scala-6fea2488af12d942c1cf7ba781d2f60fe6ddc9c0.zip
fix #2390
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 1b2fde4f4a..dd166b3086 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -307,8 +307,9 @@ trait Namers { self: Analyzer =>
ltype = new PolyTypeCompleter(tparams, ltype, tree, sym, context) //@M
if (sym.isTerm) skolemize(tparams)
}
- if ((sym.name == nme.copy || sym.name.startsWith(nme.copy + "$default$")) &&
- sym.hasFlag(SYNTHETIC)) {
+ def copyIsSynthetic() = sym.owner.info.member(nme.copy).hasFlag(SYNTHETIC)
+ if (sym.name == nme.copy && sym.hasFlag(SYNTHETIC) ||
+ sym.name.startsWith(nme.copy + "$default$") && copyIsSynthetic()){
// the 'copy' method of case classes needs a special type completer to make bug0054.scala (and others)
// work. the copy method has to take exactly the same parameter types as the primary constructor.
setInfo(sym)(mkTypeCompleter(tree)(copySym => {