summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-11-10 21:17:39 +0000
committerPaul Phillips <paulp@improving.org>2011-11-10 21:17:39 +0000
commit88e2cfae3dabf08cd854f5281b469e62fcb28d02 (patch)
treeb1c31e0757cb8ad455f52c2f1c626f10a7cae2b3
parent9f9932bd20250d243d2df04d8b42417a896dc987 (diff)
downloadscala-88e2cfae3dabf08cd854f5281b469e62fcb28d02.tar.gz
scala-88e2cfae3dabf08cd854f5281b469e62fcb28d02.tar.bz2
scala-88e2cfae3dabf08cd854f5281b469e62fcb28d02.zip
Better virtpatmat situation.
Enabled fancy type inference if opt.virtPatMat is true so one need not enable -Xexperimental to use El Virto (since I keep wasting time on edge cases arising from unrelated -Xexperimental-enabled features.) No review.
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index 7debe23a89..cb548ffdab 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -649,7 +649,8 @@ trait Infer {
targ.baseType(SeqClass)
else if (targ.typeSymbol == JavaRepeatedParamClass)
targ.baseType(ArrayClass)
- else if (targ.typeSymbol.isModuleClass || (opt.experimental && tvar.constr.avoidWiden))
+ // checks opt.virtPatmat directly so one need not run under -Xexperimental to use virtpatmat
+ else if (targ.typeSymbol.isModuleClass || ((opt.experimental || opt.virtPatmat) && tvar.constr.avoidWiden))
targ // this infers Foo.type instead of "object Foo" (see also widenIfNecessary)
else
targ.widen