aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-15 20:27:24 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-15 20:45:30 +0200
commit61f1f4dddb8e760d628cdeeb88c579f1ef0fb2a9 (patch)
treeec7b683b2404414eb397c503960be1f5711d5660
parent52d6ac3833c6daf888d48bcea06a98674243501d (diff)
downloaddotty-61f1f4dddb8e760d628cdeeb88c579f1ef0fb2a9.tar.gz
dotty-61f1f4dddb8e760d628cdeeb88c579f1ef0fb2a9.tar.bz2
dotty-61f1f4dddb8e760d628cdeeb88c579f1ef0fb2a9.zip
Companion methods should have Method flag.
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index dab84bb5f..47342cb56 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -161,12 +161,14 @@ trait Symbols { this: Context =>
owner.thisType, modcls, parents, decls, TermRef.withSymAndName(owner.thisType, module, name)),
privateWithin, coord, assocFile)
+ val companionMethodFlags = Flags.Synthetic | Flags.Private | Flags.Method
+
def synthesizeCompanionMethod(name: Name, target: SymDenotation, owner: SymDenotation)(implicit ctx: Context) =
if (owner.exists && target.exists && !owner.isAbsent && !target.isAbsent) {
val existing = owner.unforcedDecls.lookup(name)
existing.orElse{
- ctx.newSymbol(owner.symbol, name, Flags.Synthetic | Flags.Private, ExprType(target.typeRef))
+ ctx.newSymbol(owner.symbol, name, companionMethodFlags , ExprType(target.typeRef))
}
} else NoSymbol