aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Symbols.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-26 17:32:33 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-26 18:24:48 +0100
commit0a94d6e694703be747b5e3c72c5d903ecd6b3997 (patch)
treecc16abd661a3dc71647eaf31bf936eb45eecb47c /src/dotty/tools/dotc/core/Symbols.scala
parentf40c49817962235f074174dd740c3668fe9ac03f (diff)
downloaddotty-0a94d6e694703be747b5e3c72c5d903ecd6b3997.tar.gz
dotty-0a94d6e694703be747b5e3c72c5d903ecd6b3997.tar.bz2
dotty-0a94d6e694703be747b5e3c72c5d903ecd6b3997.zip
Remove code duplication between Namer, ClassfileParser and UnPickler
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index a27ce3d6a..ed59a054d 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -161,6 +161,15 @@ trait Symbols { this: Context =>
owner.thisType, modcls, parents, decls, TermRef.withSymAndName(owner.thisType, module, name)),
privateWithin, coord, assocFile)
+ def synthesizeCompanionMethod(name: TermName, ret: SymDenotation, owner: SymDenotation)(implicit ctx: Context) = {
+ if(owner.exists && ret.exists) ctx.newSymbol(
+ owner = owner.symbol,
+ name = name,
+ flags = Flags.Synthetic | Flags.Private,
+ info = ExprType(ret.typeRef))
+ else NoSymbol
+ }
+
/** Create a package symbol with associated package class
* from its non-info fields and a lazy type for loading the package's members.
*/