summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | fixing bug found by unreachabilityAdriaan Moors2012-06-011-3/+2
| | | | | |
| * | | | | Unreachability analysis for pattern matchesAdriaan Moors2012-06-0110-249/+807
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analyze matches for unreachable cases. A case is unreachable if it implies its preceding cases. Call `C` the formula that is satisfiable if the considered case matches. Call `P` the formula that is satisfiable if the cases preceding it match. The case is reachable if there is a model for `-P /\ C`. Thus, the case is unreachable if there is no model for `-(-P /\ C)`, or, equivalently, `P \/ -C`, or `C => P`. Unreachability needs a more precise model for type and value tests than exhaustivity. Before, `{case _: Int => case 1 =>}` would be modeled as `X = Int \/ X = 1.type`, and thus, the second case would be reachable if we can satisfy `X != Int /\ X = 1.type`. Of course, the case isn't reachable, yet the formula is satisfiable, so we must augment our model to take into account that `X = 1.type => X = Int`. This is done by `removeVarEq`, which models the following axioms about equality. It does so to retain the meaning of equality after replacing `V = C` (variable = constant) by a literal (fresh symbol). For each variable: 1. a sealed type test must result in exactly one of its partitions being chosen (the core of exhaustivity) 2. when a type test is true, tests of super types must also be true, and unrelated type tests must be false For example, `V : X ::= A | B | C`, and `A => B` (since `A extends B`). Coverage (1) is formulated as: `A \/ B \/ C`, and the implications of (2) are simply `V=A => V=B /\ V=X`, `V=B => V=X`, `V=C => V=X`. Exclusion for unrelated types typically results from matches such as `{case SomeConst => case OtherConst => }`. Here, `V=SomeConst.type => !V=OtherConst.type`. This is a conservative approximation. If these constants happen to be the same value dynamically (but the types don't tell us this), the last case is actually unreachable. Of course we must err on the safe side. We simplify the equality axioms as follows (in principle this could be done by the solver, but it's easy to do before solving). If we've already excluded a pair of assignments of constants to a certain variable at some point, say `(-A \/ -B)`, then don't exclude the symmetric one `(-B \/ -A)`. (Nor the positive implications `-B \/ A`, or `-A \/ B`, which would entail the equality axioms falsifying the whole formula.) TODO: We should also model dependencies between variables: if `V1` corresponds to `x: List[_]` and `V2` is `x.hd`, `V2` cannot be assigned at all when `V1 = null` or `V1 = Nil`. Right now this is implemented hackily by pruning counter-examples in exhaustivity. Unreachability would also benefit from a more faithful representation. I had to refactor some of the framework, but most of it is shared with exhaustivity. We must allow approximating tree makers twice, sharing variables, but using different approximations for values not statically known. When considering reachability of a case, we must assume, for example, that its unknown guard succeeds (otherwise it would wrongly be considered unreachable), whereas unknown guards in the preceding cases must be considered to fail (otherwise we could never get to those case, and again, it would falsely be considered unreachable). Since this analysis is relatively expensive, you may opt-out using `-Xno-patmat-analysis` (or annotating the selector with @unchecked). We hope to improve the performance in the near future. -Ystatistics has also been extended to provide some numbers on time spent in the equality-rewrite, solving and analyzing.
| * | | | | support for repeated approximation of treemakersAdriaan Moors2012-06-011-38/+47
| | | | | |
| * | | | | patmatdebugAdriaan Moors2012-06-011-60/+57
| | | | | |
| * | | | | construct typed trees in TypeTestTMAdriaan Moors2012-06-011-3/+6
| | | | | |
| * | | | | all treemakers need positions for unreachable errorAdriaan Moors2012-06-011-6/+16
| |/ / / /
* | | | | Merge pull request #648 from pvlugter/issue/5792Adriaan Moors2012-06-031-13/+8
|\ \ \ \ \ | | | | | | | | | | | | More robust findScalaHome in bash scripts
| * | | | | More robust findScalaHome in bash scripts. See SI-5792Peter Vlugter2012-06-011-13/+8
| |/ / / / | | | | | | | | | | | | | | | | | | | | Allows multiple absolute or relative symlinks by jumping through the directories while following the links.
* | | | | Merge pull request #657 from paulp/parser-booleansAdriaan Moors2012-06-031-56/+57
|\ \ \ \ \ | | | | | | | | | | | | Made parser less hostile to inspection.
| * | | | | Made parser less hostile to inspection.Paul Phillips2012-06-021-56/+57
| | |/ / / | |/| | | | | | | | | | | | | By annotating all the boolean method arguments.
* | | | | Merge pull request #658 from odersky/ticket/5399Adriaan Moors2012-06-032-1/+46
|\ \ \ \ \ | |/ / / / |/| | | | Fix for SI-5399.
| * | | | Closes t5399. Review by adriaanmMartin Odersky2012-06-022-1/+46
|/ / / /
* | | | Merge pull request #649 from magarciaEPFL/icodeAfterAnyOptimizPhaseJosh Suereth2012-06-011-11/+19
|\ \ \ \ | | | | | | | | | | allows printing .icode files after any optimiz phase
| * | | | allows printing .icode files after any optimiz phaseMiguel Garcia2012-06-011-11/+19
| |/ / /
* | | | Merge pull request #646 from magarciaEPFL/fixesAdriaan Moors2012-06-011-5/+6
|\ \ \ \ | |/ / / |/| | | skipping unnecessary work in GenASM when emitting 1.5 classfiles
| * | | skipping unnecessary work in GenASM when emitting 1.5 classfilesMiguel Garcia2012-05-311-5/+6
|/ / /
* | | Merge pull request #645 from odersky/topic/inkling-consolidatedAdriaan Moors2012-05-306-81/+158
|\ \ \ | |/ / |/| | Partial redesign of incremental compiler invalidation.
| * | Partial redesign of incremental compiler invalidation.Martin Odersky2012-05-306-81/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now do the right thing when packages are either newly created or deleted. Previously there was a problem when a new package was created inside a system package (and, unofrtunately, root is a system package). That's fixed now. We also approximate more tightly now when packages are newly created (iei the newly created symbol gets rescanned, instead of its owner). Incremental class invalidation: dealing with empty package. The compiler can now also invalidate the empty package. Previously, no invalidation was done because empty was identified with root, which is considered a system package. (1) Fixed NPE when creating a new toplevel package in invalidation. (2) generalized interface to deal with multiple entries at a time.
* | | Merge pull request #638 from lrytz/wip/t5843Adriaan Moors2012-05-303-2/+26
|\ \ \ | | | | | | | | fix t5843
| * | | fix t5843Lukas Rytz2012-05-283-2/+26
| | | |
* | | | Merge pull request #634 from retronym/ticket/4579Adriaan Moors2012-05-302-0/+519
|\ \ \ \ | |_|/ / |/| | | SI-4579 Yoke the power of lisp.scala as a stress for the optimizer.
| * | | SI-4579 Yoke the power of lisp.scala as a stress for the optimizer.Jason Zaugg2012-05-272-0/+519
| | | | | | | | | | | | | | | | The reported bug was fixed between 2.10.0-M1 and 2.10.0-M2.
* | | | Merge pull request #640 from odersky/topic/inklingAdriaan Moors2012-05-287-6/+127
|\ \ \ \ | | | | | | | | | | Implemented functionality to invalidate classpath entries
| * | | | Implemented functionality to invalidate classpath entries, to enable ↵Martin Odersky2012-05-287-6/+127
| | | | | | | | | | | | | | | | | | | | incremental compiles.
* | | | | Merge pull request #636 from retronym/ticket/5845Adriaan Moors2012-05-283-1/+24
|\ \ \ \ \ | | | | | | | | | | | | SI-5845 Advances the example from a crasher to an inference failure.
| * | | | | SI-5845 Advances the example from a crasher to an inference failure.Jason Zaugg2012-05-283-1/+24
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The inference failure itself seems like an instance of of SI-3346. But dependent method types (which triggered the crash), can be employed to avoid inferring the type constructor CC. class Num[T] { def mkOps = new Ops class Ops { def +++(rhs: T) = () } } class A { implicit def infixOps[T](lhs: T)(implicit num: Num[T]): num.Ops = num.mkOps implicit val n1: Num[Int] = new Num[Int] { } 5 +++ 5 }
* | | | | Merge pull request #635 from adriaanm/topic/virtpatmatAdriaan Moors2012-05-283-7/+17
|\ \ \ \ \ | |_|_|/ / |/| | | | fixes for exhaustivity
| * | | | handle approximating alternative of empty patternAdriaan Moors2012-05-281-1/+4
| | | | |
| * | | | don't check exhaustivity involving user-defined unapplySeqAdriaan Moors2012-05-283-6/+13
| |/ / /
* | | | Merge pull request #633 from retronym/topic/value-class-bridgeAdriaan Moors2012-05-274-2/+32
|\ \ \ \ | |/ / / |/| | | Fix a NSDNHAO in extension methods.
| * | | Fix a NSDNHAO in extension methods.Jason Zaugg2012-05-274-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A bridge method, created when we override a method from a superclass and refine the return type, was appearing as an overloaded alternative. (`erasure` doesn't create new scopes, so the bridges it builds are visible at earlier phases.) The problem was masked when compiling with specialization, which *does* create a new scope, shielding the code in question from the artefacts of erasure. To fix the problem, we filter out bridge methods from the overloaded alternatives returned by `.decl`, as would happen internally in `.member`.
* | | | Handled some of our new exhaustiveness warnings.Paul Phillips2012-05-269-11/+17
| | | | | | | | | | | | | | | | Who could have suspected it would actually be right most of the time?
* | | | Orphan checkfile remover.Paul Phillips2012-05-2638-1013/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Are these -msil checkfiles used in some secret fashion? The level of activity suggest otherwise. Since scala-nightly-msil has been disabled for over a year, it's an easy rm unless someone speaks up. % tools/rm-orphan-checkfiles Scanning for orphan check files... rm 'test/disabled/run/code.check' rm 'test/files/jvm/t1652.check' rm 'test/files/neg/macro-argtype-mismatch.check' rm 'test/files/neg/macro-noncompilertree.check' rm 'test/files/neg/macro-nontree.check' rm 'test/files/run/Course-2002-01-msil.check' rm 'test/files/run/Course-2002-02-msil.check' rm 'test/files/run/Course-2002-03-msil.check' rm 'test/files/run/Course-2002-04-msil.check' rm 'test/files/run/Course-2002-08-msil.check' rm 'test/files/run/Course-2002-09-msil.check' rm 'test/files/run/Course-2002-10-msil.check' rm 'test/files/run/absoverride-msil.check' rm 'test/files/run/bitsets-msil.check' rm 'test/files/run/boolord-msil.check' rm 'test/files/run/bugs-msil.check' rm 'test/files/run/impconvtimes-msil.check' rm 'test/files/run/infix-msil.check' rm 'test/files/run/iq-msil.check' rm 'test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.check' rm 'test/files/run/macro-rettype-mismatch.check' rm 'test/files/run/misc-msil.check' rm 'test/files/run/promotion-msil.check' rm 'test/files/run/richs-msil.check' rm 'test/files/run/runtime-msil.check' rm 'test/files/run/tuples-msil.check' rm 'test/pending/jvm/t1464.check' rm 'test/pending/run/subarray.check' rm 'test/pending/run/t0446.check' rm 'test/pending/run/t5629.check' Scanning for orphan flags files... rm 'test/files/neg/macro-argtype-mismatch.flags' rm 'test/files/neg/macro-noncompilertree.flags' rm 'test/files/neg/macro-nontree.flags' rm 'test/files/pos/anyval-children.flags' rm 'test/files/pos/t3097.flags' rm 'test/files/run/macro-invalidret-doesnt-conform-to-impl-rettype.flags' rm 'test/files/run/macro-rettype-mismatch.flags'
* | | | Help our new exhaustiveness checker.Paul Phillips2012-05-261-6/+9
|/ / / | | | | | | | | | ...be a little less chatty.
* | | Merge pull request #612 from adriaanm/ticket/5829Adriaan Moors2012-05-262-2/+20
|\ \ \ | | | | | | | | fix SI-5829: refinement typeref has a prefix
| * | | fix SI-5829: refinement typeref has a prefixAdriaan Moors2012-05-242-2/+20
| |/ /
* | | Merge pull request #626 from retronym/ticket/4818Adriaan Moors2012-05-262-0/+13
|\ \ \ | | | | | | | | Test case closes SI-4818
| * | | Test case closes SI-4818Jason Zaugg2012-05-252-0/+13
| | | | | | | | | | | | | | | | Fixed between 2.10.0 M2 and M3, with both the old and new pattern matcher.
* | | | Merge pull request #630 from retronym/ticket/5041Adriaan Moors2012-05-261-0/+9
|\ \ \ \ | | | | | | | | | | Test case closes SI-5041.
| * | | | Test case closes SI-5041.Jason Zaugg2012-05-261-0/+9
| | | | |
* | | | | Merge pull request #629 from retronym/ticket/4911Adriaan Moors2012-05-262-0/+17
|\ \ \ \ \ | |/ / / / |/| | | | Test case closes SI-4911.
| * | | | Test case closes SI-4911.Jason Zaugg2012-05-262-0/+17
|/ / / / | | | | | | | | | | | | The unchecked warning departed sometime between 4afae5be...278a225.
* | | | Merge pull request #625 from retronym/ticket/5318-3Adriaan Moors2012-05-258-35/+70
|\ \ \ \ | | | | | | | | | | SI-5318 Make implicit divergence checking PolyType aware.
| * | | | SI-5318 Make implicit divergence checking PolyType aware.Jason Zaugg2012-05-258-35/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces the two active subclasses of `SymCollector` with direct use of traversal methods of `Type`. Wildcard free class type parameters, not just method type parameters, when stripping the core type of candidate implicits. The spec doesn't make any such distinction, and the enclosed test, t5318c, crashes without this change.
* | | | | Merge pull request #624 from hubertp/topic/cleanupJosh Suereth2012-05-253-23/+1
|\ \ \ \ \ | | | | | | | | | | | | Cleaning up some code introduced for the old presentation compiler long ...
| * | | | | Cleaning up some code introduced for the old presentation compiler long time ↵Hubert Plociniczak2012-05-243-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | ago. Review by @dragos
* | | | | | Merge pull request #613 from hubertp/issue/5821Adriaan Moors2012-05-256-11/+35
|\ \ \ \ \ \ | | | | | | | | | | | | | | Closes SI-5821.
| * | | | | | Closes SI-5821.Hubert Plociniczak2012-05-246-11/+35
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was an interesting one. Basically an erroneous import was creating an erroneous symbol for Array (similary for other symbols that were 'found' in this import) which was leading to all sorts of inconsistencies and spurious errors. This wasn't a bug in ContextErrors but rather something that existed for ages and was hidden from the general audience. Review by @paulp.
* | | | | | Merge pull request #621 from axel22/issue/5085bAdriaan Moors2012-05-251-4/+22
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fixes SI-5085 and SI-4833.
| * | | | | | Fixes SI-5085 and SI-4833.Aleksandar Prokopec2012-05-251-4/+22
| | |_|_|/ / | |/| | | |