summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1880 from som-snytt/issue/6894-javap-appPaul Phillips2013-01-1511-65/+118
|\ | | | | Fixes and features for javap (fixing SI-6894)
| * Restore pending repl-javap tests that now succeed under java 6.Som Snytt2013-01-118-0/+0
| | | | | | | | Knock on wood.
| * Fixes and features for javap (fixing SI-6894)Som Snytt2013-01-113-65/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Output filtering is refactored for javap6. That means javap6 also supports -raw. Handling of # is: Foo#foo filter on foo, Foo# filter on apply, -fun Foo#foo for anonfuns of foo, -fun Foo# anonfuns filtering on apply. One is loath to add command options, so it's not possible to ask for "only apply methods in anonfuns pertaining to a method." Hypothetical syntax to say "show me the apply only": -fun Foo#foo(), for future reference.
* | Merge pull request #1881 from adriaanm/rebase-1879-masterPaul Phillips2013-01-153-1/+30
|\ \ | | | | | | SI-6955 switch emission no longer foiled by type alias
| * | SI-6955 switch emission no longer foiled by type aliasAdriaan Moors2013-01-113-1/+30
| |/ | | | | | | | | | | | | dealiasWiden the type of the scrutinee before checking it's switchable now with tests! (using IcodeTest since javap is not available everywhere) rebase of #1879
* | Merge pull request #1897 from retronym/ticket/6964Paul Phillips2013-01-15171-1902/+3
|\ \ | | | | | | SI-6964 Remove build managers, both simple and refined.
| * | SI-6964 Remove build managers, both simple and refined.Jason Zaugg2013-01-12171-1902/+3
| |/ | | | | | | | | | | | | | | | | Deprecated in 2.10.0, out to pasture in 2.11.0. Users are advised to migrate to: https://github.com/typesafehub/zinc http://www.scala-sbt.org/
* | Merge pull request #1803 from paulp/issue/6375Paul Phillips2013-01-155-7/+145
|\ \ | | | | | | SI-6375, warn on lost annotation.
| * | Tweaked meta-annotation error based on feedback.Paul Phillips2013-01-142-12/+13
| | |
| * | SI-6375, warn on lost annotation.Paul Phillips2013-01-144-2/+128
| | | | | | | | | | | | | | | | | | | | | Annotations on abstract vals which are not meta-annotated were silently discarded. Still discarded, only less silently. I warned on as many "lost annotation" situations as I was reasonably able to cover without false positives.
| * | Cleaned up meta-annotations.Paul Phillips2013-01-141-5/+16
| | | | | | | | | | | | | | | | | | | | | There were some missing and some others not added to the set of meta-annotations. I added the missing ones and defined the set in such a way as to include them all, even those which have not yet been born.
* | | Merge pull request #1877 from adriaanm/rebase-1876-masterAdriaan Moors2013-01-143-17/+16
|\ \ \ | | | | | | | | SI-5189 detect unsoundness when inferring type of match
| * | | remove hack for old patmat unnecessary in 2.11Adriaan Moors2013-01-141-16/+2
| | | |
| * | | SI-5189 detect unsoundness when inferring type of matchAdriaan Moors2013-01-143-6/+19
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GADT skolems encode type slack that results from pattern matching on variant type constructors I thought they would not longer be relevant after cases have been typed, and since they caused weird issues with the old pattern matcher, I deskolemized in typedCase however, when we don't have an expected type for the match, we need to keep the skolems around until the skolemized type makes it out of the match and it becomes the result of type inference for that match when you do have an expected type, it will propagate to the case-level and the confrontation will thus already take place when typing individual cases
* | | Merge pull request #1886 from retronym/ticket/6966Adriaan Moors2013-01-142-2/+23
|\ \ \ | |/ / |/| | SI-6966 Fix regression in implicit resolution
| * | SI-6966 Fix regression in implicit resolutionJason Zaugg2013-01-122-2/+23
| | | | | | | | | | | | | | | Reverts this line: 9c09c17#L50L671. That value was apparantly discarded intentionally.
* | | Merge pull request #1837 from julio/fix-typoAdriaan Moors2013-01-143-8/+8
|\ \ \ | | | | | | | | Fix dependant => dependent
| * | | Fix dependant => dependentJulio Santos2013-01-023-8/+8
| | | |
* | | | Merge pull request #1896 from retronym/topic/remove-equals-pattern-classPaul Phillips2013-01-142-4/+1
|\ \ \ \ | |_|/ / |/| | | Remove EqualsPatternClass.
| * | | Remove EqualsPatternClass.Jason Zaugg2013-01-142-4/+1
|/ / / | | | | | | | | | | | | Detritus from the classic pattern matcher, which was recently removed 6084d2d9.
* | | Merge pull request #1885 from paulp/merge/pr-1844Paul Phillips2013-01-1144-165/+484
|\ \ \ | | | | | | | | Resolving new merge conflicts between #1844 and master.
| * \ \ Merge commit 'refs/pull/1844/head' into merge/pr-1844Paul Phillips2013-01-1144-165/+484
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'refs/pull/1844/head': macroExpandAll is now triggered by typed SI-5923 adapt macros when they are deferred generalizes macroExpand typedPrimaryConstrBody now returns supercall more precise errors for macros parentTypes => typedParentTypes changes isTermMacro checks to something more universal fixes printing of AppliedTypeTree adds Trees.replace(Tree, Tree) makes macro override error more consistent refactors handling of macros in repl SI-5903 extractor macros do work adds c.macroRole Conflicts: src/compiler/scala/tools/nsc/typechecker/Macros.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * | | macroExpandAll is now triggered by typedEugene Burmako2013-01-096-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously delayed macro expansions (the sole purpose of macroExpandAll) were triggered by `typedArgs`. Probably I wanted to save CPU cycles on not checking whether we have pending macro expansions on every iteration of typecheck. However this optimization is uncalled for, because the check just entails reading a var, therefore benefits of the current approach are negliible, whereas the robustness hit is tangible. After delayed macro expansion mechanism became more robust, it exposed a bug, well-hidden before. If one first delays a macro and then finds out that the expandee is erroneous, subsequent `macroExpandAll` will crash, because it expects a macro runtime attachment to be present. Previously the erroneous code path never got triggered, because the macro expansion never commenced. Luckily the fix was easy.
| | * | | SI-5923 adapt macros when they are deferredEugene Burmako2013-01-0911-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amazingly enough, the fix for the "macro not expanded" problem was super easy. (And I remember spending a day or two trying to find a quick fix somewhen around Scala Days 2012!) The problem was in the implementation of the macro expansion trigger, which was buried in a chain of if-elif-elif. This meant that macro expansion was mutually exclusive with a lot of important adaptations, e.g. with `instantiate`. More precisely, if an expandee contains an undetparam, its expansion should be delayed until all its undetparams are inferred and then retried later. Sometimes such inference can only happen upon a call to instantiate in one of the elif's coming after the macro expansion elif. However this elif would never be called for expandees, because control flow would always enter the macro expansion branch preceding the inference branch. Consequences of this fix are vast. First of all, we can get rid of the "type parameter must be specified" hack. Secondly and most importantly, we can now remove the `materializeImplicit` method from Implicits and rely on implicit macros to materialize tags for us. (This is a tricky change, and I'll do it later after we merge as much of my pending work as possible). Finally, we learn that the current scheme of interaction between macros, type inference and implicits is, in principle, sound!
| | * | | generalizes macroExpandEugene Burmako2013-01-096-89/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes macroExpand to accommodate expansion schemes different from the currently supported one. As a bonus, which follows clarification of the macro expansion logic, this refactoring fixes suppression of macro expansions, which previously didn't work with delayed expansion.
| | * | | typedPrimaryConstrBody now returns supercallEugene Burmako2013-01-091-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously this method returned the entire block with supercall being potentially wrapped in early defs. However when implementing type macros, I found it more convenient to have typedPrimaryConstrBody to only return the supercall itself. This doesn't make any difference for our current codebase, since the only time anyone cares about the return value, it's only to inspect its tpe. Therefore I'm submitting this patch in a preparatory pull request to reduce the surface of changes in the upcoming type macros pull request.
| | * | | more precise errors for macrosEugene Burmako2013-01-092-5/+13
| | | | |
| | * | | parentTypes => typedParentTypesEugene Burmako2013-01-093-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | I felt really uncomfortable having to stare at `parentTypes`, when everyone else in Typers.scala is named typedSomething.
| | * | | changes isTermMacro checks to something more universalEugene Burmako2013-01-097-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously I wanted to be as precise as possible, but as the experience with type macros shows, a lot of isTermMacro checks should also extend to include type macros. Therefore I'm changing the checks to isMacro. This doesn't make any difference for existing code, but will reduce the amount of changes in the upcoming type macro pull request.
| | * | | fixes printing of AppliedTypeTreeEugene Burmako2013-01-091-8/+12
| | | | |
| | * | | adds Trees.replace(Tree, Tree)Eugene Burmako2013-01-092-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Currently dead code. Has proven to be useful to implement type macros, therefore I'm moving it to scala.reflect.internal.Trees.
| | * | | makes macro override error more consistentEugene Burmako2013-01-094-5/+5
| | | | |
| | * | | refactors handling of macros in replEugene Burmako2013-01-093-15/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Macros now have a dedicated member handler, so that the logic of their processing doesn't get mixed up with vanilla DefHandler. I've also factored out an abstract MacroHandler to provides a basis to build the upcoming type macro handler upon.
| | * | | SI-5903 extractor macros do workEugene Burmako2013-01-098-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently it is already possible to use macros to customize pattern matching as described in the comments to the aforementioned JIRA issue. What's even better - with the incoming addition of c.introduceTopLevel it becomes possible to generate arbitrarily complex unappliers, even with heterogeneous types of arguments varying from expansion to expansion
| | * | | adds c.macroRoleEugene Burmako2013-01-093-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently there's only one flavor of macros - def macros, and the plan was to gradually introduce additional flavors, such as type macros and macro annotations. However as shown by the experience with type macros, it makes sense to distinguish subflavors of macros that tell us in which context the macro gets expanded. For def macros we have the only role - expansion of an application. But for type macros there are multiple.
* | | | | Merge pull request #1856 from retronym/topic/sbt-git-movePaul Phillips2013-01-111-1/+1
|\ \ \ \ \ | | | | | | | | | | | | sbt-git-plugin has moved.
| * | | | | sbt-git-plugin has moved.Jason Zaugg2013-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to eliminate these sort of shifting sands to make the SBT build a viable option.
* | | | | | Merge pull request #1862 from retronym/ticket/6641-2.11.xPaul Phillips2013-01-112-52/+0
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-6641 Cull scala.swing.SwingWorker
| * | | | | SI-6641 Cull scala.swing.SwingWorkerJason Zaugg2013-01-082-52/+0
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears to do nothing much at all, refers to the now-deprecated scala.actor package, and has a name clash with an important class from java.swing. Note that the POM for scala-swing does not declare the dependency. The final nail in the coffin is it aides and abets the crash in the crash in SI-6440. Attempts to remove or even deprecate this in 2.10.0 were missed the boat. This commit removes them for 2.11.0, in contravention of the deprecation policy. Given that they rely on the scala-actors module which _is_ deprecated in 2.10.0, and will likely be removed in 2.11.0, I contend that this is a reasonable exception. Actor.scala
* | | | | Merge pull request #1874 from paulp/pr/mode-value-classPaul Phillips2013-01-1116-184/+205
|\ \ \ \ \ | |_|_|_|/ |/| | | | Made "mode" into a value class.
| * | | | Made "mode" into a value class.Paul Phillips2013-01-0916-184/+205
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an obvious place to apply value class goodness and collect some safety/sanity in typing modes. It does show off a challenge in introducing value classes without disruption: there's no way to deprecate the old signature of 'typed', 'adapt', etc. because they erase the same. class Bippy(val x: Int) extends AnyVal class A { @deprecated("Use a bippy") def f(x: Int): Int = 5 def f(x: Bippy): Int = x.x } ./a.scala:5: error: double definition: method f:(x: Bippy)Int and method f:(x: Int)Int at line 4 have same type after erasure: (x: Int)Int An Int => Mode implicit handles most uses, but nothing can be done to avoid breaking anything which e.g. extends Typer and overrides typed.
* | | | Merge pull request #1883 from paulp/repl-javapPaul Phillips2013-01-118-0/+0
|\ \ \ \ | | | | | | | | | | Moved repl javap tests into pending.
| * | | | Moved repl javap tests into pending.Paul Phillips2013-01-118-0/+0
|/ / / / | | | | | | | | | | | | For not passing on java6.
* | | | Merge pull request #1873 from paulp/pr/variance-bonanzaPaul Phillips2013-01-1037-479/+1249
|\ \ \ \ | | | | | | | | | | a painstaking examination of Variance
| * | | | Renamed isTrackingVariance to trackVariance.Paul Phillips2013-01-093-12/+12
| | | | |
| * | | | SI-5378, unsoundness with type bounds in refinements.Paul Phillips2013-01-094-48/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the comment says: Not enough to look for abstract types; have to recursively check the bounds of each abstract type for more abstract types. Almost certainly there are other exploitable type soundness bugs which can be seen by bounding a type parameter by an abstract type which itself is bounded by an abstract type. SPECIAL: BUY ONE UNSOUNDNESS, GET ONE FREE In refinement types, only the first parameter list of methods was being analyzed for unsound uses of abstract types. Second parameter list and beyond had free unsoundness reign. That bug as well is fixed here.
| * | | | SI-6566, unsoundness with alias variance.Paul Phillips2013-01-0914-14/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This wasn't as bad as it could have been. All these changes plug soundness holes in trunk. Mostly we're looking at type aliases which were merely protected when they had to be protected[this] not to allow unsound variance crossover.
| * | | | Boosted test coverage.Paul Phillips2013-01-095-0/+601
| | | | |
| * | | | Handle variance exclusions in a less ad hoc manner.Paul Phillips2013-01-092-16/+29
| | | | |
| * | | | Eliminated redundant validateVariance.Paul Phillips2013-01-092-81/+61
| | | | | | | | | | | | | | | | | | | | It had repeated all the TypeMap logic. I made it a TypeMap.