summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index ff24719b18..c9916219b0 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -514,7 +514,7 @@ trait Namers { self: Analyzer =>
def apply(tp: Type) = {
tp match {
case SingleType(_, sym) =>
- if (sym.owner == meth && (vparams contains sym)) {
+ if (settings.Xexperimental.value && sym.owner == meth && (vparams contains sym)) {
/*
if (sym hasFlag IMPLICIT) {
context.error(sym.pos, "illegal type dependence on implicit parameter")
@@ -541,8 +541,10 @@ trait Namers { self: Analyzer =>
if (sym.owner == meth && (vparamSymss exists (_ contains sym)))
context.error(
sym.pos,
- "illegal dependent method type: parameter appears in the type "+
- "of another parameter in the same section or an earlier one")
+ "illegal dependent method type"+
+ (if (settings.Xexperimental.value)
+ ": parameter appears in the type of another parameter in the same section or an earlier one"
+ else ""))
case _ =>
mapOver(tp)
}