From 4b76eeaa13176aede421af3fe86c392c438b0e5d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 2 Nov 2015 22:24:54 +0100 Subject: Add scalaMode and testScalaMode to TypeOps --- src/dotty/tools/dotc/core/TypeOps.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/dotty/tools/dotc/core') 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 { -- cgit v1.2.3