summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* ASM now compiled once in the build.Josh Suereth2012-05-2377-0/+0
| | | | | | | | * Moved ASM sources to src/asm * New ant task builds asm *ONCE*. Build times improve by a few seconds * Fixed SBT build for new asm location. SBT build still broken from actors-migration and partest Review by @magarciaEPFL
* Merge pull request #595 from som-snytt/ticket/3761-overload-byname-onlyLukas Rytz2012-05-231-3/+15
|\ | | | | SI-3761: Overload resolution fails on by-name parameter
| * SI-3761: Overload resolution fails on by-name parameter (amended per lrytz)Som Snytt2012-05-221-2/+1
| | | | | | | | Lukas noted the stopgap at methTypeArgs isn't needed. What! No black tie formals.
| * SI-3761: Overload resolution fails on by-name parameterSom Snytt2012-05-211-4/+17
| | | | | | | | | | | | | | | | | | | | | | When isAsSpecific checks if method m applies to args of types of formal params of m1, a by-name parameter was converted to its underlying result type for the params (of m) but not the args (of m1). This had the useful effect of making m(A) more specific than m(=>A), which is the specified prioritization for implicit views, but also made m(=>A) and m(=>A, B*) ambiguous. To handle this edge case, the isCompatible test for A and =>A is made explicit, and by-name params are no longer converted.
* | Merge pull request #575 from vjovanov/actors-migration-kitAdriaan Moors2012-05-2322-20/+660
|\ \ | | | | | | Adding the Actor Migration Kit.
| * | Minor fixes for the Actor Migration KitVojin Jovanovic2012-05-234-24/+19
| | | | | | | | | | | | | | | | | | | | | Fixed behavior of the StashingActor in case of unhandeled message. Fixed a typo in deprecated annotation. Fixed comments. Fixed copyright.
| * | Adding the Actor Migration Kit.Vojin Jovanovic2012-05-1821-15/+660
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kit consists of: 1) The StashingActor which adopts an interface similar to Akka. 2) Props mockup for creating Akka like code 3) Pattern mockup 4) Test cases for every step in the migration. 5) MigrationSystem which will paired on the Akka side. Review of the code : @phaller Review of the build: @jsuereth
* | | Merge pull request #601 from adriaanm/3f7b8b58748eb70aec4269f1ef63853b5ad4af60Adriaan Moors2012-05-235-236/+1115
|\ \ \ | | | | | | | | virtpatmat: treemaker approximation refactorings and exhaustivity
| * | | Exhaustivity: TreeMakers as boolean propositionsAdriaan Moors2012-05-225-9/+712
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We check exhaustivity by representing a match as a formula in finite-domain propositional logic (FDPL) that is false when the match may fail. The variables in the formula represent tested trees in the match (type tests/value equality tests). The approximation uses the same framework as the CSE analysis. A matrix of tree makers is turned into a DAG, where sharing represents the same value/type being tested. We reduce FDPL to Boolean PL as follows. For all assignments, V_i = c_i_j, we introduce a proposition P_i_j that is true iff V_i is equal to the constant c_i_j, for a given i, and all j, P_i_j are mutually exclusive (a variable cannot have multiple values). If the variable's domain is closed, we assert that one of P_i_j must be true for each i and some j. The conjunction of these propositions constitutes the equality axioms. After going through negational normal form to conjunctive normal form, we use a small SAT solver (the DPLL algorithm) to find a model under which the equational axioms hold but the match fails. The formula: EqAxioms /\ -MatchSucceeds. Note that match failure expresses nicely in CNF: the negation of each case (which yields a disjunction) is anded. We then turn this model into variable assignments (what's the variable (not) equal to, along with recursive assignments for its fields). Valid assignments (no ill-typed field assignments) are then presented to the user as counter examples. A counter example is a value, a type test, a constructor call or a wildcard. We prune the example set and only report the most general examples. (Finally, we sort the output to yield stable, i.e. testable, warning messages.) A match is only checked for exhaustivity when the type of the selector is "checkable" (has a sealed type or is a tuple with at least one component of sealed type). We consider statically known guard outcomes, but generally back off (don't check exhaustivity) when a match has guards or user-defined extractor calls. (Sometimes constant folding lets us statically decide a guard.) We ignore possibly failing null checks (which are performed before calling extractors, for example), though this could be done easily in the current framework. The problem is false positives. People don't usually put nulls in tuples or lists. To improve the exhaustivity checks, we rewrite `List()` to Nil. TODO: more general rewrite of List(a, b, ..., z) to `a :: b :: ... :: z`. When presenting counter examples, we represent lists in the user-friendly List(a,...,z) format. (Similarly for tuples.) There are no exhaustivity checks for a match-defined PartialFunction. misc notes: - fix pure case of dpll solver impure set (symbol that occurs both as a positive and negative literal) was always empty since I was looking for literals (which are not equal if positivity is not equal) but should have been looking for symbols - FDPL -> BoolPL translation collects all syms in props since propForEqualsTo generates an Or, must traverse the prop rather than assuming only top-level Syms are relevant... also, propForEqualsTo will not assume Or'ing a whole domain is equivalent to True (which it isn't, since the type test may fail in general) - improve counter example description - treat as constructor call when we either have definite type information about a real class, or we have no equality information at all, but the variable's type is a class and we gathered constraints about its fields (typically when selector is a tuple) - flatten a :: b :: ... :: Nil to List(a, b, ...) - don't print tuple constructor names, so instead of "Tuple2(a, b)", say "(a, b)" - filter out more statically impossible subtypes the static types convey more information than is actually checkable at run time this is good, as it allows us to narrow down the subtypes of a sealed type, however, when modeling the corresponding run-time checks we need to "erase" the uncheckable parts (using existentials so that the types are still well-kinded), so that we can use static subtyping as a sound model for dynamic type checks - experimental java enum handling seals enum class before, we created a refinement class as the placeholder for the sealed children it seems more direct to use the enum class for that this way, the new pattern matcher's exhaustiveness checker just works for java enums
| * | | TreeMaker approximation refactorings and bug fixesAdriaan Moors2012-05-221-225/+401
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - TypeTestTreeMaker subsumes the old TypeTestTM and TypeAndEqualityTM its type- and equality-testing logic is configurable so that it can: - generate trees (main purpose) - check whether this tree maker is a pure type test - generate the proposition that models this tree maker (for exhaustivity and other analyses) - [CSE] subst binders of dropped tm's to stored ones somehow the refactoring broke the replacement of the binder of dropped treemakers by the binder of the reused treemaker when replacing TM1(x1 => ...) >> TM2(x2 => ...) >> TM3(x3 => ...) >> ... TM1'(x1' => ...) >> TM2'(x2' => ...) >> TM3(x3' => ...) >> ... by Memo1(x1 => ...) >> TM2(x2 => ...) >> Memo2(x3 => ...) >> ... Reuse(Memo2)... you need to replace x1' and x2' by x1 since TM2 tested a shared condition but was not memo-ised, that implies it simply passed x1 through to x3 unmodified, and x2' can simply use the stored x1 - type of first uniqued binder sets type of tree when approximating a tree of treemakers as a DAG, where sharing indicates the same value is tested, use the type of the binder that was first used to create a unique tree as the type of that tree, and thus all trees used for the same binder in the future - track substitution of alternatives when approximating - error on unswitchable @switch annotated matches if we can't turn a match (with more than two cases) into a switch, but the user insists, emit an error misc notes: - when all you need is nextBinder, FunTreeMaker is your guy - must pass flag to TypeTestTM for extractorarg test case TypeTestTreeMaker(prevBinder, testedBinder, expectedTp, nextBinderTp) (prevBinder eq testedBinder) does not imply it's a pure type test for an extractor call note that the expected type for an extractor argument is not a type pattern, thus we only do a classic type test -- the idea was to detect that case by noticing we're being called with the same previous and tested binder, but that case also arises for Typed patterns
* | | Merge pull request #599 from som-snytt/ticket/5779-numeq-warnAdriaan Moors2012-05-222-3/+12
|\ \ \ | | | | | | | | SI-5779: Wrong warning message (comparing Number)
| * | | SI-5779: Wrong warning message (comparing Number)Som Snytt2012-05-221-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Massage the predicates for readability. Thanks to Adriaan for the push. As an outsider, one tries to tread lightly by minimizing the number of chars changed in the source, which is the wrong optimization. This code remains as it was (not amenable to extension). This commit also deletes the flag I'd introduced to say that an exhaustive check had already been done. For the record, I renamed it to something less silly before I zapped it.
| * | | SI-5779: Wrong warning message (comparing values of types Float/Double and ↵Som Snytt2012-05-212-4/+9
| |/ / | | | | | | | | | | | | | | | Number using `==' will always yield false) BoxesRuntime knows how to compare java.lang.Number, so we must not warn.
* | | Merge pull request #602 from hubertp/issue/5735Adriaan Moors2012-05-222-36/+42
|\ \ \ | | | | | | | | Closes SI-5735. Review by @adriaanm.
| * | | Last minor cleanupHubert Plociniczak2012-05-221-3/+3
| | | |
| * | | More consistent solution for errorenous situations when infering the ↵Hubert Plociniczak2012-05-222-39/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alternative. From now on we specify explicity which attempt is tried and setError on the tree depending on that. Relying on the context was a nice idea to avoid that but was fragile when we were in the silent mode (like checking named arguments).
| * | | Closes SI-5735, this could also potentially fix a SO problem that @adriaanm ↵Hubert Plociniczak2012-05-212-4/+8
| | |/ | |/| | | | | | | was experiencing in IDE but could not reproduce it.
* | | Merge pull request #592 from retronym/ticket/4975Adriaan Moors2012-05-221-1/+1
|\ \ \ | | | | | | | | Consider method-scoped companions in the implicit scope.
| * | | Consider method-scoped companions in the implicit scope.Jason Zaugg2012-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes SI-4975. I'll reproduce a relevant snippet of dialogue from Namers#companionSymbolOf: /** The companion class or companion module of `original`. * Calling .companionModule does not work for classes defined inside methods. * * !!! Then why don't we fix companionModule? Does the presence of these * methods imply all the places in the compiler calling sym.companionModule are * bugs waiting to be reported? If not, why not? When exactly do we need to * call this method? */ def companionSymbolOf(original: Symbol, ctx: Context): Symbol = { This was one such bug.
* | | | Merge pull request #596 from magarciaEPFL/ticket-SI-5672Adriaan Moors2012-05-223-5/+25
|\ \ \ \ | | | | | | | | | | fix for SI-5672
| * | | | fix for SI-5672Miguel Garcia2012-05-213-5/+25
| | |_|/ | |/| |
* | | | Merge pull request #588 from retronym/ticket/5305Adriaan Moors2012-05-221-4/+1
|\ \ \ \ | | | | | | | | | | Don't hop to the first enclosing, non-silent context typing refinements
| * | | | Don't hop to the first enclosing, non-silent context when typing refinements.Jason Zaugg2012-05-061-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes SI-5305. This reverts a few lines of e5cfe47a19, which was a remedy for SI-3614 and SI-3856*. I added a test case for the former, the latter was already tested. Both tests pass after this change, and they do so with the old and new pattern matcher. But does this change still "avoid trees with null types in presentation compiler"? What was the intent of the context hopping in the first place? * Based on this comment: https://issues.scala-lang.org/browse/SI-3614?focusedCommentId=50477&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-50477, which elaborates further than the commit comment of e5cfe47a19.
* | | | | Merge pull request #598 from retronym/ticket/2405Adriaan Moors2012-05-222-5/+9
|\ \ \ \ \ | | | | | | | | | | | | SI-2405 Confer implicit privileges to renamed imports.
| * | | | | SI-2405 Confer implicit privileges to renamed imports.Jason Zaugg2012-05-222-5/+9
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yin and yang would be pleased: A fix in two parts. 1. Use the name of the imported symbol, rather than the alias, in the generated `Select(qual, name)` tree. 2. Do the opposite in `isQualifyingImplicit`, which performs one part of the shadowing check. But there is still work to do. The second part of the shadowing check, `nonImplicitSynonymInScope`, fails to notice this case (irrespective of aliased imports). // Expecting shadowing #2. Alas, none is cast! object Test1 { object A { implicit val x: Int = 1 } import A.x def x: Int = 0 implicitly[Int] } I'm hitching the residual problem to SI-4270's wagon.
* | | | | Merge pull request #604 from hubertp/issue/5044Adriaan Moors2012-05-222-2/+6
|\ \ \ \ \ | | | | | | | | | | | | More info regarding SI-5044. Already discussed with @lrytz.
| * | | | | Better diagnosis for the SI-5044 fixHubert Plociniczak2012-05-221-0/+4
| | | | | |
| * | | | | For the benefit of future debugger users, let the context print some more ↵Hubert Plociniczak2012-05-221-2/+2
| |/ / / / | | | | | | | | | | | | | | | useful information about error reporting
* | | | | Merge pull request #583 from heathermiller/scaladoc/keyboard-shortcutsJosh Suereth2012-05-221-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Fix to Scaladoc keyboard shortcuts for Firefox
| * | | | | Fix to Scaladoc keyboard shortcuts for FirefoxHeather Miller2012-05-201-1/+1
| | | | | |
* | | | | | Merge pull request #586 from axel22/issue/5804Josh Suereth2012-05-222-15/+13
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Fixes SI-5804.
| * | | | | Fixes SI-5804.Aleksandar Prokopec2012-05-182-15/+13
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash table initialSize method is now within the the hashset and hashmap classes, and not in the companion. Overriding this method now yields hashmaps and hashsets of the proper initial capacity. Review by @phaller.
* | | | | Merge pull request #593 from som-snytt/ticket/5760-pkgobj-warnAdriaan Moors2012-05-211-1/+5
|\ \ \ \ \ | | | | | | | | | | | | SI-5760: Improve error message for package$Klass conflict with Klass
| * | | | | SI-5760: Improve error message for package$Klass conflict with KlassSom Snytt2012-05-201-1/+5
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a clarification to DoubleDefError for when the previous symbol was in the package object but current symbol is not. This was actually supposed to be an opportunity to hack partest to run the two-step failing compilation, but somebody beat me to it and my rebase failed. The next hacking opportunity might be to add .pt script files! The possibilities are endless.
* | | | | Merge pull request #587 from retronym/ticket/5125Adriaan Moors2012-05-211-10/+18
|\ \ \ \ \ | | | | | | | | | | | | Fix @varargs forwarder generation in the presence of nested templates.
| * | | | | Fix @varargs forwarder generation in the presence of nested templates.Jason Zaugg2012-05-201-10/+18
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | Makes `newMembers` a Map[Symbol, Buffer[Tree]] to ensure we add the forwarders to the right template. Closes SI-5125.
* | | | | Merge pull request #576 from axel22/issue/4717Adriaan Moors2012-05-211-13/+15
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | Fix SI-4717: lazy val declared inside an anonymous class inside a specialized context no longer crashes Duplicators.
| * | | | Fixes previous commit.Aleksandar Prokopec2012-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | Should be checking if the owner of the new symbol is a class, not the new symbol itself.
| * | | | Further fixes SI-4717.Aleksandar Prokopec2012-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only adding a lazy val into list of declarations if the owner is a class. Review by dragos. @mention dragos
| * | | | Fixes SI-4717.Aleksandar Prokopec2012-05-183-32/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lazy val declared inside an anonymous class inside a specialized context no longer crashes Duplicators. Previously, a duplicated lazy val was assigned to the wrong owner in Duplicators: def x[B >: A]: Unit = new Bounds[B] { lazy val it = ??? // def or val okay } Above, the `it` in `$anon` in `x$mcZ$sp` had its owner set to `x$mcZ$sp` instead of `$anon`. This crashed the typer when it had to retype its lazy accessor, because there was no `lazy var it` in `$anon$`. Furthermore, the duplicated symbol wasn't being added to the list of declarations of `$anon`. Changes: 1) `invalidate` in Duplicators takes an additional parameter which is the new owner of the new symbol that has to be duplicated. If this parameter is set to `NoSymbol`, then the new owner is `context.owner`, as before. 2) the newly created lazy val symbol is being added to the list of declarations of its new owner. Removes debugging output from the previous commit. Review by dragos. @mention dragos
| * | | | Add more logging.Aleksandar Prokopec2012-05-153-8/+22
| | | | |
* | | | | Merge pull request #582 from heathermiller/scaladoc/keyboard-shortcutsAdriaan Moors2012-05-195-166/+276
|\ \ \ \ \ | | |_|/ / | |/| | | Fix SI-5055 (for real). Implement keyboard shortcuts in Scaladoc. Browsing is fun again!
| * | | | Actually fixes SI-5055. Scaladoc now a zillion times less annoyingHeather Miller2012-05-191-16/+36
| | | | |
| * | | | Adds ability to navigate Scaladoc with arrow keysHeather Miller2012-05-192-149/+229
| | | | |
| * | | | Minor fix to Tab-switch keyboard shortcutHeather Miller2012-05-181-2/+2
| | | | |
| * | | | Added Scaladoc keyboard shortcut: tab toggles between panelsHeather Miller2012-05-184-5/+15
| | |/ / | |/| |
* | | | Merge pull request #581 from lrytz/t4812-uncAdriaan Moors2012-05-191-3/+8
|\ \ \ \ | | | | | | | | | | Fix SI-4812: handle trait method with Symbol as default for argument
| * | | | Fix 4812Lukas Rytz2012-05-191-3/+8
| | | | | | | | | | | | | | | | | | | | Remove default arguments from parameter ValDefs in UnCurry.
* | | | | Merge pull request #578 from lrytz/wip/t5044-squashedAdriaan Moors2012-05-192-2/+15
|\ \ \ \ \ | | | | | | | | | | | | fix SI-5044: better error message on cyclic error and named/default args
| * | | | | better feedback for SI-5044Lukas Rytz2012-05-182-2/+15
| | | | | |