summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-04-09 16:22:02 +0000
committerMartin Odersky <odersky@gmail.com>2010-04-09 16:22:02 +0000
commit2dba26ed12c86c63a568b85a4c094c22c7937412 (patch)
tree0c83870326e9fe3a8220ec49835eb4e463b1f9d6 /src/compiler/scala/tools/nsc/typechecker/Namers.scala
parentc46a200d8cead57030d007ca841e23ccdcd7bd55 (diff)
downloadscala-2dba26ed12c86c63a568b85a4c094c22c7937412.tar.gz
scala-2dba26ed12c86c63a568b85a4c094c22c7937412.tar.bz2
scala-2dba26ed12c86c63a568b85a4c094c22c7937412.zip
Interrupted attempt to fix #2897.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 9ac628034f..a78ee61ee2 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -384,18 +384,13 @@ trait Namers { self: Analyzer =>
mods &~ LOCAL
} else mods
// add getter and possibly also setter
- val accflags: Long = ACCESSOR |
- (if (mods1.isVariable) mods1.flags & ~MUTABLE & ~PRESUPER
- else mods1.flags & ~PRESUPER | STABLE)
if (nme.isSetterName(name))
context.error(tree.pos, "Names of vals or vars may not end in `_='")
// .isInstanceOf[..]: probably for (old) IDE hook. is this obsolete?
- val getter = enterAliasMethod(tree, name, accflags, mods1)
+ val getter = enterAccessorMethod(tree, name, getterFlags(mods1.flags), mods1)
setInfo(getter)(namerOf(getter).getterTypeCompleter(vd))
if (mods1.isVariable) {
- val setter = enterAliasMethod(tree, nme.getterToSetter(name),
- accflags & ~STABLE & ~CASEACCESSOR,
- mods1)
+ val setter = enterAccessorMethod(tree, nme.getterToSetter(name), setterFlags(mods1.flags), mods1)
setInfo(setter)(namerOf(setter).setterTypeCompleter(vd))
}
@@ -468,7 +463,7 @@ trait Namers { self: Analyzer =>
sym
}
- def enterAliasMethod(tree: Tree, name: Name, flags: Long, mods: Modifiers): TermSymbol =
+ def enterAccessorMethod(tree: Tree, name: Name, flags: Long, mods: Modifiers): TermSymbol =
enterNewMethod(tree, name, flags, mods, tree.pos.focus)
private def addBeanGetterSetter(vd: ValDef, getter: Symbol) {
@@ -508,7 +503,7 @@ trait Namers { self: Analyzer =>
// known. instead, uses the same machinery as for the non-bean setter:
// create and enter the symbol here, add the tree in Typer.addGettterSetter.
val setterName = "set" + beanName
- val setter = enterAliasMethod(vd, setterName, flags, mods)
+ val setter = enterAccessorMethod(vd, setterName, flags, mods)
.setPos(vd.pos.focus)
setInfo(setter)(namerOf(setter).setterTypeCompleter(vd))
}