diff options
author | Martin Odersky <odersky@gmail.com> | 2016-11-10 11:54:27 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-12-01 13:55:12 +0100 |
commit | 2b12868070be50fb70c687bcd8a415acbe398e3e (patch) | |
tree | f3977e7e9408ff6adc14f4ef6e685e710f310410 /compiler/src/dotty/tools/dotc/core/Definitions.scala | |
parent | 4ae76f2164e91d6a26519304b5ac5df527ae9207 (diff) | |
download | dotty-2b12868070be50fb70c687bcd8a415acbe398e3e.tar.gz dotty-2b12868070be50fb70c687bcd8a415acbe398e3e.tar.bz2 dotty-2b12868070be50fb70c687bcd8a415acbe398e3e.zip |
New phase for entering annotations
If we want to do annotation macros right, we need to add
annotations before completing definitions. This commit achieves
that by adding a new "phase" between index and typecheck.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Definitions.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 4b090d9b1..c5ccab261 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -650,6 +650,13 @@ class Definitions { def isTupleClass(cls: Symbol) = isVarArityClass(cls, tpnme.Tuple) def isProductClass(cls: Symbol) = isVarArityClass(cls, tpnme.Product) + val predefClassNames: Set[Name] = + Set("Predef$", "DeprecatedPredef", "LowPriorityImplicits").map(_.toTypeName) + + /** Is `cls` the predef module class, or a class inherited by Predef? */ + def isPredefClass(cls: Symbol) = + (cls.owner eq ScalaPackageClass) && predefClassNames.contains(cls.name) + val StaticRootImportFns = List[() => TermRef]( () => JavaLangPackageVal.termRef, () => ScalaPackageVal.termRef |