From 7c236d237ccfd6e249d7ee24bb94663195f5e65e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 26 Jul 2007 17:41:00 +0000 Subject: disabled dependent method types unless -Xexperi... disabled dependent method types unless -Xexperimental --- src/compiler/scala/tools/nsc/typechecker/Namers.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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) } -- cgit v1.2.3