diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 9 |
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. */ |