aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.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/typer/Typer.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/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 019c460e8..34400ede7 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1092,7 +1092,13 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
.withType(dummy.nonMemberTermRef)
checkVariance(impl1)
if (!cls.is(AbstractOrTrait) && !ctx.isAfterTyper) checkRealizableBounds(cls.typeRef, cdef.pos)
- assignType(cpy.TypeDef(cdef)(name, impl1, Nil), cls)
+ val cdef1 = assignType(cpy.TypeDef(cdef)(name, impl1, Nil), cls)
+ if (ctx.phase.isTyper && cdef1.tpe.derivesFrom(defn.DynamicClass) && !ctx.dynamicsEnabled) {
+ val isRequired = parents1.exists(_.tpe.isRef(defn.DynamicClass))
+ ctx.featureWarning(nme.dynamics.toString, "extension of type scala.Dynamic", isScala2Feature = true,
+ cls, isRequired, cdef.pos)
+ }
+ cdef1
// todo later: check that
// 1. If class is non-abstract, it is instantiatable: