summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* SI-5675 Discard duplicate feature warnings at a positionJason Zaugg2013-02-081-3/+3
| | | | | | | | | | When -feature has not been enabled, we were double counting identical feature warnings that were emitted at the same position. Normal error reporting only reports the first time a warning appears at a position; feature warning counter incrementing should behave the same way. @hubertp: Fixed .check files that were broken in the original commit.
* Merge pull request #2039 from scalamacros/ticket/7046Eugene Burmako2013-02-041-1/+5
|\ | | | | SI-7046 reflection now auto-initializes knownDirectSubclasses
| * SI-7046 reflection now auto-initializes knownDirectSubclassesEugene Burmako2013-01-311-1/+5
| | | | | | | | | | | | knownDirectSubclasses joins the happy family of flags, annotations and privateWithin, which automatically trigger initialization, when used within runtime reflection.
* | Merge pull request #2022 from lrytz/analyzerPlugins210Lukas Rytz2013-02-0316-380/+739
|\ \ | | | | | | Analyzer Plugins
| * | Fix context for type checking early initializersLukas Rytz2013-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: scala> class A { class C extends { val x: A = this } with AnyRef } <console>:7: error: type mismatch; found : A.this.C required: A class A { class C extends { val x: A = this } with AnyRef } ^ Note that the same thing is necessary and already done in Namers (see def createNamer). The whole logic of when and how to create contexts should be factored out and reused in Namer and Typer. ( My Hobby [1]: detecting compiler by just looking at its soruce [1] http://www.explainxkcd.com/wiki/index.php?title=Category:My_Hobby )
| * | Analyzer PluginsLukas Rytz2013-02-039-131/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AnnotationCheckers are insufficient because they live outside the compiler cake and it's not possible to pass a Typer into an annotation checker. Analyzer plugins hook into important places of the compiler: - when the namer assigns a type to a symbol (plus a special hook for accessors) - before typing a tree, to modify the expected type - after typing a tree, to modify the type assigned to the tree Analyzer plugins and annotation checker can be activated only during selected phases of the compiler. Refactored the CPS plugin to use an analyzer plugin (since adaptToAnnotations is now part of analyzer plugins, no longer annotation checkers).
| * | SI-1803, plus documentation and cleanups in Namers, mainly in typeSigLukas Rytz2013-02-036-226/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - when typing (and naming) a ValDef, tpt and rhs are now type checked in the same context (the inner / ValDef context). this does not change any behavior, but is more uniform (same as for DefDef). martin told me (offline) that this change is desirable if it doesn't break anything. (it doesn't). - typeSig is now more uniform with a separate method for each case (methodSig, valDefSig, etc). methodSig was cleaned up (no more variables) and documented. the type returned by methodSig no longer contains / refers to type skolems, but to the actual type parameters (so we don't need to replace the skolems lateron). - documentation on constructor contexts, type skolems - more tests for SI-5543
| * | Keep annotations when computing lubsLukas Rytz2013-02-031-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | Integrates annotationsLub into lub. Also fixes SubstSymMap when mapping over annotaion trees. I don't understand what the previous code was supposed to achieve, but it crashed in some of my examples.
| * | Allow for Function treess with refined types in UnCurry.Lukas Rytz2013-02-032-8/+17
| | | | | | | | | | | | | | | Also removes an unnecessary condition in UnCurry, isFunctionType(fun.tpe) is always true.
| * | case module toString is syntheticLukas Rytz2013-02-031-1/+1
| | |
| * | replace symbols correctly when subtyping dependent typesLukas Rytz2013-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | as discussed in [1], this change has no impact on the scala type system, but it can fix subtyping for annotation checkers if the pluggable type system supports annotations that can refer to method parameters. [1] https://groups.google.com/forum/#!topic/scala-internals/kSJLzYkmif0/discussion
* | | Merge pull request #1976 from retronym/backport/1468James Iry2013-02-033-72/+139
|\ \ \ | | | | | | | | [backport] SI-6428 / SI-7022 Value class with bounds
| * | | [backport] SI-6482, lost bounds in extension methods.Jason Zaugg2013-02-023-72/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 5c156185306ba797c0443d9dccae0ae7ce462a1f Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 15:42:50 2012 -0700 A little more housecleaning in ExtensionMethods. The only real contribution is readability. (cherry picked from commit 61f12faacaaccf366f9211ba6493fb042a91f1d2) Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala commit 79f443edf584745d614e24fb9ca6644c6b18d439 Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 14:22:19 2012 -0700 Incorporated pull request feedback. (cherry picked from commit 153ccb4757718cceb219988f30381f73362e6075) commit 707f580b0cdcb01e27ca4c76991dea427945b5bd Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 10:20:45 2012 -0700 Fix for SI-6482, lost bounds in extension methods. That was a good one. How to create a new method with type parameters from multiple sources, herein. (cherry picked from commit ff9f60f420c090b6716c927ab0359b082f2299de) commit 8889c7a13f74bc175e48aa2209549089a974c2af Author: Paul Phillips <paulp@improving.org> Date: Fri Oct 5 22:19:52 2012 -0700 Responded to comment about how many isCoercibles there are. I make the case that there is only one. (cherry picked from commit 883f1ac88dd7cec5882d42d6b48d7f267d1f6e00)
* | | | Merge pull request #2033 from adriaanm/patmat-optAdriaan Moors2013-02-033-46/+262
|\ \ \ \ | | | | | | | | | | pattern matching efficiency: addresses SI-6686 and SI-6941, affects SI-5739
| * | | | SI-6686 drop valdef unused in flatMapCond's blockAdriaan Moors2013-01-311-5/+11
| | | | |
| * | | | no type test if static type <:< primitive value classAdriaan Moors2013-01-311-18/+26
| | | | |
| * | | | don't store subpats bound to underscoreAdriaan Moors2013-01-311-11/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | also, tweak fix in place for SI-5158 to appease SI-6941 don't store mutable fields from scala.* as we can assume these classes are well-behaved and do not mutate their case class fields
| * | | | no null check for type-tested unapply argAdriaan Moors2013-01-311-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pattern matching on case classes where pattern is not known to be a subclass of the unapply's argument type used to result in code like: ``` if (x1.isInstanceOf[Foo]) { val x2 = x1.asInstanceOf[Foo] if (x2 != null) { // redundant ... } } ``` this wastes byte code on the redundant null check with this patch, when previous type tests imply the variable cannot be null, there's no null check
| * | | | refactor: prepare null check redundancy analysisAdriaan Moors2013-01-311-13/+38
| | | | | | | | | | | | | | | | | | | | this commit doesn't change any behavior
| * | | | support testing bytecode similarity in ByteCodeTestAdriaan Moors2013-01-312-61/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one similarity measure comes free of charge: it ignores which variable is stored/loaded, everything else must be identical like this: `similarBytecode(methNodeA, methNodeB, equalsModuloVar)` also implemented prettier diffing
| * | | | bytecode diffing support in ByteCodeTestAdriaan Moors2013-01-311-4/+73
| | |_|/ | |/| | | | | | | | | | | | | | use sameByteCode(methodNode1, methodNode2) to check methods compile to identical bytecode (line number info is not taken into account)
* | | | Merge pull request #1911 from kzys/jira-4976Adriaan Moors2013-02-021-6/+9
|\ \ \ \ | | | | | | | | | | SI-4976 Scaladoc: Add a source link to package objects
| * | | | SI-4976 Scaladoc: Add a source link to package objectsKato Kazuyoshi2013-01-171-6/+9
| | | | |
* | | | | Merge pull request #2044 from phaller/issue/7029Adriaan Moors2013-02-022-9/+27
|\ \ \ \ \ | | | | | | | | | | | | SI-7029 - Makes sure that uncaught exceptions are propagated to the UEH ...
| * | | | | SI-7029 - Makes sure that uncaught exceptions are propagated to the UEH for ↵Viktor Klang2013-01-312-9/+27
| | |/ / / | |/| | | | | | | | | | | | | the global ExecutionContext
* | | | | Merge pull request #2019 from scalamacros/ticket/6539Eugene Burmako2013-02-014-17/+34
|\ \ \ \ \ | |_|_|_|/ |/| | | | SI-6539 moves @compileTimeOnly away from scala-reflect
| * | | | SI-6539 moves @compileTimeOnly away from scala-reflectEugene Burmako2013-01-314-17/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The move is done to provide forward compatibility with 2.10.0. The annotation isn't replaced with one of the macro-based solutions right away (see comments for more information about those), because we lack necessary tech in 2.10.x.
* | | | | Merge pull request #2024 from scalamacros/ticket/6812Eugene Burmako2013-02-013-3/+9
|\ \ \ \ \ | |_|_|_|/ |/| | | | SI-6812 scaladoc can opt out of expanding macros
| * | | | SI-6812 scaladoc can opt out of expanding macrosEugene Burmako2013-01-313-3/+9
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a temporary change, possible only because macros currently can't affect the global symbol table (except for the case when they will steer inference of a method's return type). Later on, e.g. with the addition of c.introduceTopLevel in master, we will have to upgrade Scaladoc to allow for separate generation of documentation, because then we'll be forced to expand macros in order to get the whole picture of the code.
* | | | Merge pull request #1979 from retronym/backport/1499James Iry2013-02-011-9/+15
|\ \ \ \ | | | | | | | | | | [backport] Fix for SI-6206, inconsistency with apply.
| * | | | [backport] Fix for SI-6206, inconsistency with apply.Jason Zaugg2013-01-261-9/+15
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit f6bbf85150cfd7e461989ec1d6765ff4b4aeba51 Author: Paul Phillips <paulp@improving.org> Date: Mon Oct 1 09:10:45 2012 -0700 Fix for SI-6206, inconsistency with apply. The code part of this patch is 100% written by retronym, who apparently has higher standards than I do because I found it just lying around in his repository. I think I'll go pick through his trash and see if he's throwing away any perfectly good muffins. I made the test case more exciting so as to feel useful. (cherry picked from commit 267650cf9c3b07e360a59f3c5b70b37fea9de453)
* | | | Merge pull request #1975 from retronym/ticket/6601-revertJames Iry2013-02-012-2/+1
|\ \ \ \ | | | | | | | | | | Revert "SI-6601 Publicise derived value contstructor after pickler"
| * | | | Revert "SI-6601 Publicise derived value contstructor after pickler"Jason Zaugg2013-01-262-2/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b07228aebe7aa620af45a681ef60d945ffc65665. The remedy was far worse than the disease: % cat sandbox/test.scala class V private (val a: Any) extends AnyVal % RUNNER=scalac scala-hash b07228aebe sandbox/test.scala [info] b07228aebe => /Users/jason/usr/scala-v2.10.0-256-gb07228a % scala-hash b07228aebe [info] b07228aebe => /Users/jason/usr/scala-v2.10.0-256-gb07228a Welcome to Scala version 2.10.1-20130116-230935-b07228aebe (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27). Type in expressions to have them evaluated. Type :help for more information. scala> def foo(v: V) = v.a == v.a exception when typing v.a().==(v.a())/class scala.reflect.internal.Trees$Apply constructor V in class V cannot be accessed in object $iw in file <console> scala.reflect.internal.Types$TypeError: constructor V in class V cannot be accessed in object $iw
* | | | Merge pull request #2026 from JamesIry/2.10.x_SI-2818Grzegorz Kossakowski2013-02-011-0/+3
|\ \ \ \ | | | | | | | | | | SI-2818 Makes List#foldRight work for large lists
| * | | | SI-2818 Make List.foldRight always do a reverse/foldLeft flipJames Iry2013-01-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmarks show that lists smaller than 110 elements or so doing reverse/foldLeft is faster than recursively walking to the end of the list and then folding as the stack unwinds. Above that 110 element threshold the recursive procedure is faster. Unfortunately, at some magic unknown large size the recursive procedure blows the stack. This commit changes List#foldRight to always do reverse/foldLeft.
* | | | | Merge pull request #1980 from retronym/backport/1518Adriaan Moors2013-02-011-0/+6
|\ \ \ \ \ | | | | | | | | | | | | [backport] SI-2968 Fix brace healing for `^case (class|object) {`
| * | | | | [backport] SI-2968 Fix brace healing for `^case (class|object) {`Jason Zaugg2013-01-261-0/+6
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 24828531f62ce05402c96c04d7096e82d5f4e3bf Author: Jason Zaugg <jzaugg@gmail.com> Date: Sun Oct 21 23:34:35 2012 +0200 SI-2968 Fix brace healing for `^case (class|object) {` The scanner coalesces the pair of tokens into CASEOBJECT or CASECLASS, but fails to set `offset` back to the start of `case`. Brace healing is then unable to correctly guess the location of the missing brace. This commit resets `offset` and `lastOffset`, as though caseobject were a single keyword. Only the former was neccessary to fix this bug; I haven't found a test that shows the need for the latter. (cherry picked from commit cbad218dba47d49a39897b86d467c384538fdd53)
* | | | | Merge pull request #1998 from JamesIry/2.10.x_6963_2Adriaan Moors2013-02-017-10/+247
|\ \ \ \ \ | | | | | | | | | | | | SI-6963 Add version to -Xmigration
| * | | | | SI-6963 Add version to -XmigrationJames Iry2013-01-297-10/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an optional version parameter to the -Xmigration compiler setting. Doing -Xmigration without version number behaves as it used to by dumping every possible migration warning. This commit adds a ScalaVersion class (plus ancillary stuff), and a ScalaVersionSetting.
* | | | | | Merge pull request #2043 from lrytz/t3353Adriaan Moors2013-02-011-28/+36
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-3353 don't extract <unapply-selector> into named-arg local val
| * | | | | | SI-3353 don't extract <unapply-selector> into named-arg local valLukas Rytz2013-01-311-28/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This already fixes all of SI-3353 because no named-args-block is generated anymore (they are avoided if they have a single expr). So the same NPE in extractorFormalTypes as described in the ticket is no longer triggered. I think that's all there is to fix, since extractor patterns are translated to unapply calls with one argument, i think it's not possible to write a pattern that would result in a named-apply block.
* | | | | | | Merge pull request #1909 from kzys/jira-6017-2.10.xJames Iry2013-02-011-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6017 Scaladoc's Index should be case-sensitive
| * | | | | | | SI-6017 Scaladoc's Index should be case-sensitiveKato Kazuyoshi2013-01-161-1/+1
| | |_|_|_|_|/ | |/| | | | |
* | | | | | | Merge pull request #1960 from ViniciusMiana/2.10.xJames Iry2013-02-011-6/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6853 changed private method remove to be tail recursive.
| * | | | | | | SI-6853 changed private method remove to be tail recursive.Vinicius Miana2013-01-251-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Operations += and -= on mutable.ListMap rely on the private method remove to perform. This methods was implemented using recursion, but it was not tail recursive. When the ListMap got too big the += caused a StackOverflowError.
* | | | | | | | Merge pull request #2015 from paulp/rc1-backportsPaul Phillips2013-01-3111-75/+110
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | 10 backports
| * | | | | | | | SI-6595, lost modifiers in early defs.Paul Phillips2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] Saw this by accident; the trees created for early defs would wholesale replace the modifiers with PRESUPER rather than combining them. FINAL was lost that way, as would be any other modifiers which might be valid there.
| * | | | | | | | SI-6584, Stream#distinct uses too much memory.Paul Phillips2013-01-301-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] Nesting recursive calls in Stream is always a dicey business.
| * | | | | | | | SI-6426, importable _.Paul Phillips2013-01-302-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] Prohibit `_` as an identifier, it can only bring badness.
| * | | | | | | | SI-6072, crasher with overloaded eq.Paul Phillips2013-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] You don't want to do name-based selections in later phases if you can help it, because there is nobody left to resolve your overloads. If as in this example you're calling a known method, use the symbol. Review by @hubertp.