aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorNicolas Stucki <nicolas.stucki@gmail.com>2016-06-03 15:00:10 +0200
committerNicolas Stucki <nicolas.stucki@gmail.com>2016-07-07 11:10:45 +0200
commit5a7cacbb37f8f1edfded03a095eb45c04a883185 (patch)
treee00dc214c0c8236141f0d99531e0d211f77df8df /src/dotty/tools/dotc/core/TypeOps.scala
parent75da0358fd7866f3dccdfcf4fbeae9af8ccc69f3 (diff)
downloaddotty-5a7cacbb37f8f1edfded03a095eb45c04a883185.tar.gz
dotty-5a7cacbb37f8f1edfded03a095eb45c04a883185.tar.bz2
dotty-5a7cacbb37f8f1edfded03a095eb45c04a883185.zip
Add scala.Dynamic language feature check.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 1288c0b23..3da119a9c 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -455,7 +455,8 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
*/
def featureEnabled(owner: ClassSymbol, feature: TermName): Boolean = {
def toPrefix(sym: Symbol): String =
- if (sym eq defn.LanguageModuleClass) "" else toPrefix(sym.owner) + sym.name + "."
+ if (!sym.exists || (sym eq defn.LanguageModuleClass) || (sym eq defn.Scala2LanguageModuleRef)) ""
+ else toPrefix(sym.owner) + sym.name + "."
def featureName = toPrefix(owner) + feature
def hasImport(implicit ctx: Context): Boolean = (
ctx.importInfo != null
@@ -477,6 +478,9 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
def scala2Mode =
featureEnabled(defn.LanguageModuleClass, nme.Scala2)
+ def dynamicsEnabled =
+ featureEnabled(defn.Scala2LanguageModuleClass, nme.dynamics)
+
def testScala2Mode(msg: String, pos: Position) = {
if (scala2Mode) migrationWarning(msg, pos)
scala2Mode