diff options
author | Paul Phillips <paulp@improving.org> | 2011-11-10 21:17:39 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-11-10 21:17:39 +0000 |
commit | 88e2cfae3dabf08cd854f5281b469e62fcb28d02 (patch) | |
tree | b1c31e0757cb8ad455f52c2f1c626f10a7cae2b3 /src | |
parent | 9f9932bd20250d243d2df04d8b42417a896dc987 (diff) | |
download | scala-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 3 |
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 |