diff options
author | Dmitry Petrashko <dark@d-d.me> | 2015-04-28 11:35:34 +0200 |
---|---|---|
committer | Dmitry Petrashko <dark@d-d.me> | 2015-04-28 11:35:34 +0200 |
commit | a18b3faeda0a33843bb60cb1475c974aff3a1621 (patch) | |
tree | 5f1f515abc423b1168a0ab75d2e52675267e4f46 /src/dotty/tools/dotc/core/Symbols.scala | |
parent | 6d1138e2ce2d212c051faa20e1f4bf419ede3fdf (diff) | |
parent | 2b3591cec6a1d58f3346b6c8933ca0742f13c1cf (diff) | |
download | dotty-a18b3faeda0a33843bb60cb1475c974aff3a1621.tar.gz dotty-a18b3faeda0a33843bb60cb1475c974aff3a1621.tar.bz2 dotty-a18b3faeda0a33843bb60cb1475c974aff3a1621.zip |
Merge pull request #495 from dotty-staging/refactor/SuperAccessors
Refactor/super accessors
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 52040bcfd..9f18e723c 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -228,8 +228,8 @@ trait Symbols { this: Context => newSymbol(cls, nme.localDummyName(cls), EmptyFlags, NoType) /** Create an import symbol pointing back to given qualifier `expr`. */ - def newImportSymbol(expr: Tree, coord: Coord = NoCoord) = - newSymbol(NoSymbol, nme.IMPORT, EmptyFlags, ImportType(expr), coord = coord) + def newImportSymbol(owner: Symbol, expr: Tree, coord: Coord = NoCoord) = + newSymbol(owner, nme.IMPORT, EmptyFlags, ImportType(expr), coord = coord) /** Create a class constructor symbol for given class `cls`. */ def newConstructor(cls: ClassSymbol, flags: FlagSet, paramNames: List[TermName], paramTypes: List[Type], privateWithin: Symbol = NoSymbol, coord: Coord = NoCoord) = @@ -558,13 +558,17 @@ object Symbols { ctx.newSymbol(owner, name, flags, info, privateWithin, coord) } - implicit def defn(implicit ctx: Context): Definitions = ctx.definitions - /** Makes all denotation operations available on symbols */ implicit def toDenot(sym: Symbol)(implicit ctx: Context): SymDenotation = sym.denot /** Makes all class denotations available on class symbols */ implicit def toClassDenot(cls: ClassSymbol)(implicit ctx: Context): ClassDenotation = cls.classDenot + /** The Definitions object */ + def defn(implicit ctx: Context): Definitions = ctx.definitions + + /** The current class */ + def currentClass(implicit ctx: Context): ClassSymbol = ctx.owner.enclosingClass.asClass + var stubs: List[Symbol] = Nil // diagnostic } |