aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-11-02 22:24:54 +0100
committerMartin Odersky <odersky@gmail.com>2015-11-05 13:57:37 +0100
commit4b76eeaa13176aede421af3fe86c392c438b0e5d (patch)
treeca75631b01e9b803af50302d6eb39f688e308a76 /src/dotty/tools/dotc/core/TypeOps.scala
parent4850629d244156d96a2a1bad231cddc0084d0d31 (diff)
downloaddotty-4b76eeaa13176aede421af3fe86c392c438b0e5d.tar.gz
dotty-4b76eeaa13176aede421af3fe86c392c438b0e5d.tar.bz2
dotty-4b76eeaa13176aede421af3fe86c392c438b0e5d.zip
Add scalaMode and testScalaMode to TypeOps
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 77c6805f0..aa643256c 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -5,6 +5,7 @@ package core
import Contexts._, Types._, Symbols._, Names._, Flags._, Scopes._
import SymDenotations._, Denotations.Denotation
import config.Printers._
+import util.Positions._
import Decorators._
import StdNames._
import util.SimpleMap
@@ -572,6 +573,15 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
/** Is auto-tupling enabled? */
def canAutoTuple =
!featureEnabled(defn.LanguageModuleClass, nme.noAutoTupling)
+
+ def scala2Mode =
+ featureEnabled(defn.LanguageModuleClass, nme.Scala2)
+
+ def testScala2Mode(msg: String, pos: Position) = {
+ if (scala2Mode) migrationWarning(msg, pos)
+ scala2Mode
+ }
+
}
object TypeOps {