summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 3b3eb74745..29762360ea 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -454,6 +454,8 @@ trait Namers { self: Analyzer =>
finishWith(tparams)
case DefDef(mods, name, tparams, _, _, _) =>
tree.symbol = enterNewMethod(tree, name, mods.flags, mods, tree.pos)
+ if (mods.annotations.exists(ann => isAnn(ann, "bridge")))
+ tree.symbol setFlag BRIDGE
finishWith(tparams)
case TypeDef(mods, name, tparams, _) =>
var flags: Long = mods.flags
@@ -496,14 +498,15 @@ trait Namers { self: Analyzer =>
def enterAccessorMethod(tree: Tree, name: Name, flags: Long, mods: Modifiers): TermSymbol =
enterNewMethod(tree, name, flags, mods, tree.pos.focus)
+ def isAnn(ann: Tree, demand: String) = ann match {
+ case Apply(Select(New(Ident(name)), _), _) =>
+ name.toString == demand
+ case Apply(Select(New(Select(pre, name)), _), _) =>
+ name.toString == demand
+ case _ => false
+ }
+
private def addBeanGetterSetter(vd: ValDef, getter: Symbol) {
- def isAnn(ann: Tree, demand: String) = ann match {
- case Apply(Select(New(Ident(name)), _), _) =>
- name.toString == demand
- case Apply(Select(New(Select(pre, name)), _), _) =>
- name.toString == demand
- case _ => false
- }
val ValDef(mods, name, tpt, _) = vd
val hasBP = mods.annotations.exists(isAnn(_, "BeanProperty"))
val hasBoolBP = mods.annotations.exists(isAnn(_, "BooleanBeanProperty"))