summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2287 from vigdorchik/ticket/si-7102James Iry2013-03-221-0/+13
|\ | | | | SI-7102 Override isEmpty for bitsets with an efficient implementation
| * SI-7102 Specialize isEmpty for bitsetsEugene Vigdorchik2013-03-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | Currently bitsets use default isEmpty implementation inherited from Set, which tests for "size == 0". Calculating the size of a word in a bitmap requires summing through all bits set, whereas testing for emptyness needs only one comparison with zero. This commit overrides the default implementation with the specialized one looking for a non-zero word in this bitmap.
* | Merge pull request #2239 from paulp/pr/warningsAdriaan Moors2013-03-213-0/+25
|\ \ | |/ |/| Warnings removal and other cleanup.
| * Warn about forgotten string interpolators.Paul Phillips2013-03-123-0/+25
| | | | | | | | | | | | | | | | In the compiler sources this arrives with a number of false positives, because we frequently work with strings containing $foo where foo is an in-scope identifier. I think in normal source code this will be less of a problem, or none at all; but to be conservative the warning is born under -Xlint.
* | Merge pull request #2235 from vigdorchik/si_5513James Iry2013-03-202-0/+27
|\ \ | | | | | | SI-5513: add inplace set-theoretic operations for mutable bitsets.
| * | SI-5513: add inplace set-theoretic operations for mutable bitsets.Eugene Vigdorchik2013-03-112-0/+27
| | |
* | | Merge pull request #2244 from paulp/pr/notNullAdriaan Moors2013-03-177-26/+10
|\ \ \ | | | | | | | | SI-7247, deprecate NotNull.
| * | | SI-7247, deprecated NotNull.Paul Phillips2013-03-137-26/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed NotNull from tests and the parentage of AnyVal. Removed the tests which were actually testing anything to do with NotNull; massaged the others to forget NotNull and/or not to name local things NotNull.
* | | | Merge pull request #2214 from JamesIry/master_constant_optimizationJames Iry2013-03-1513-13/+192
|\ \ \ \ | |/ / / |/| | | Analyze constants to remove unnecessary branches
| * | | Cleanup of constant optimizationJames Iry2013-03-146-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit cleans up constant optimization from the review of https://github.com/scala/scala/pull/2214 . * drops are done using the instruction's consumed count rather than a numeric literal * drops are moved into one common method in the main instruction interpreter * One instance of x.length > y.length is replaced with x.lengthCompare(y.length) > 0 * NaN is dealt with by treating it as an UNKNOWN * A test is added to make sure NaN semantics aren't broken. * The constant-optmization test is improved with tests for switch statements
| * | | Analyze constants to remove unnecessary branchesJames Iry2013-03-079-13/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds analysis and optimization of constants to remove unnecessary branches. It uses abstract interpretation to determine what constant(s) a particular stack slot or variable might or might not hold at a given spot and uses that knowledge to eliminate branches that cannot be taken. Its primary goal is null check removal, but it also works for other constants. Several tests are modified to include the new optimization phase. Two new tests are added. One verifies that branching still works as expected. The other verifies that branches are removed.
* | | | Merge pull request #2215 from paulp/issue/7228Paul Phillips2013-03-133-19/+76
|\ \ \ \ | | | | | | | | | | SI-7228, bug in subtyping.
| * | | | Simplified the widening logic.Paul Phillips2013-03-102-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should speak for itself. Whenever someone changed @switch from an error to a warning, it broke all the tests which depended on the error. I added -Xfatal-warnings to a couple which needed it. And one of those tests was then failing, as it must now since we couldn't get away with what was being attempted, so I moved it to pending.
| * | | | SI-7228, bug in weak subtyping.Paul Phillips2013-03-101-0/+75
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another in the category of bugs which involve narrowing, widening, mediuming, dealiasing, weakening, normalizing, denormalizing, supernormalizing, subnormalizing, and double-bounded supersubnormalizing. This is probably not the ideal fix, but it is an improvement.
* | | | Merge pull request #2242 from adriaanm/merge-2.10.xPaul Phillips2013-03-1315-1/+310
|\ \ \ \ | | | | | | | | | | Merge 2.10.x into master
| * \ \ \ Merge 2.10.x into masterAdriaan Moors2013-03-1213-0/+142
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/reflect/reify/Errors.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
| | * \ \ \ Merge pull request #2224 from retronym/ticket/7238Adriaan Moors2013-03-112-0/+13
| | |\ \ \ \ | | | | | | | | | | | | | | SI-7328 Bail out of names/defaults when args are error typed
| | | * | | | SI-7328 Bail out of names/defaults if args are error typedJason Zaugg2013-03-092-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid a crasher later on with a null type inside a sequence argument.
| | * | | | | Merge pull request #2225 from retronym/ticket/7234Adriaan Moors2013-03-112-0/+35
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | SI-7234 Make named args play nice with dep. method types
| | | * | | | | SI-7234 Make named args play nice with dep. method typesJason Zaugg2013-03-092-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some care is needed to avoid interaction with constant types (e.g pos/z1730.scala) and with existentials (e.g. t3507-old.scala).
| | * | | | | | Merge pull request #2221 from scalamacros/ticket/5710Adriaan Moors2013-03-114-0/+32
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-5710 has fixed itself
| | | * | | | | | SI-5710 has fixed itselfEugene Burmako2013-03-094-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My job here is only to submit tests.
| | * | | | | | | Merge pull request #2223 from scalamacros/ticket/7235Adriaan Moors2013-03-114-0/+36
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | reifier is now aware of SI-7235
| | | * | | | | | | reifier is now aware of SI-7235Eugene Burmako2013-03-094-0/+36
| | | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-7235 is caused by a long-standing todo in typedRefinement, which leads to originals of compound type trees swallowing their stats. I'm not sure how exactly to fix SI-7235, but what I am sure about is that we shouldn't silently discard stats during reification. This patch introduces a new implementation restrictions, which now reports that reify of compound type trees with non-empty stats isn't going to work.
| | * | | / / / / SI-7226 Fix inference regression caused by TypeVar equality.Jason Zaugg2013-03-091-0/+26
| | | |_|/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TypeVars, being mutable creatures, mustn't have structural equality/hashing, otherwise TypeRefs that differ only by having distinct TypeVars as components get wrongly uniqued together. The reported bug showed the disaterous consequences: constraints from the `C?[Int]` in the return type applied to the `?C[?A]` in the parameter list. This commit overrides `equals` and `hashCode` in `TypeVar` to use reference equality. An alternative fix would be to drop the `case`-ness of the class, as was the case before 0cde930b when this regressed.
| * | | | | | | Merge 2.10.x into masterAdriaan Moors2013-03-122-1/+168
| |\| | | | | | | | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * | | | | Fix SI-7224.Iulian Dragos2013-03-072-1/+168
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't focus positions assigned to the TypeTree of a parent of a Template when the parent exists in the source. A focused position (instance of `OffsetPosition`) makes it invisible to the presentation compiler when it looks for the innermost enclosing tree of a given position (breaking hyperlinking, for example).
* | | | | | Merge pull request #2236 from retronym/ticket/6601-2Paul Phillips2013-03-125-0/+25
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6601 Close access loophole for value class constructors
| * | | | | | SI-6601 Close access loophole for value class constructorsJason Zaugg2013-03-115-0/+25
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ExtensionMethods marks private constructors of value classes as notPRIVATE before pickling. When the pickler reads the flags of this symbol, the anti-shift mechanism folds this into the regular PRIVATE flag, so the class is pickled as though it was public all along. A seprately compiled client can then call this constructor. To remedy this, we must: - pickle `rawFlags`, rather than `flags`. This is symmetric with unpickling, which sets `rawFlags` with the value it reads. - Add `notPRIVATE` to the flagset `PickledFlags`. We cannot make this change in a minor version, as the pickler and unpickler must agree on `PickledFlags`. I believe that this won't change the size of pickled flags for the majority of symbols (ie, those without the notPRIVATE flag) due to the variable length encoding in `writeLongNat`. This also improves the situation for SI-6608. Reflection and scalap (and, by extension, IntelliJ), no longer will see as public methods that have had their access widened in SuperAccessors (which is done selectively to support inlining under separate compilation.)
* / / / / / Warn about locally identifiable init order issues.Paul Phillips2013-03-123-0/+33
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This warns about a subset of initialization order issues which can easily be identified by inspection, such as val x = y val y = 5 The likelihood of this formulation being intentional is miniscule.
* | | | | Eliminated all forInteractive/forScaladoc uses.Paul Phillips2013-03-097-2/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the commit which brings it all together. The booleans forInteractive and forScaladoc are now deprecated and are not inspected for any purpose. All behavioral changes formerly accomplished via tests of those flags are embodied in the globals built specifically for those tasks.
* | | | | Moved scaladoc code into src/scaladoc.Paul Phillips2013-03-095-167/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This leverages the preceding several commits to push scaladoc specific code into src/scaladoc. It also renders some scanner code more comprehensible.
* | | | | Moved scaladoc sources into separate directory.Paul Phillips2013-03-092-206/+0
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This change is not externally visible. It moves the scaladoc sources into src/scaladoc and adds an ant target for building them. The compilation products are still packaged into scala-compiler.jar as before, but with a small change to build.xml a separate jar can be created instead.
* | | | SI-7006 Fix the unreachable testJames Iry2013-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | The unreachable test was missing the cases when Random.nextInt returned a negative number. This commit fixes that.
* | | | Merge pull request #2216 from JamesIry/master_7231James Iry2013-03-082-0/+13
|\ \ \ \ | | | | | | | | | | SI-7231 Fix assertion when adapting Null type to Array type
| * | | | SI-7231 Fix assertion when adapting Null type to Array typeJames Iry2013-03-082-0/+13
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GenICode was doing a sanity check when adapting an expression of type Null to something else. It was just doing the wrong one. Instead of checking whether the result expression type was a reference type it was checking to see if it was an class reference type. This commit fixes that and adds a test to make sure both forms of adaptation work as expected.
* | | | Merge pull request #2185 from JamesIry/master_unreachableGrzegorz Kossakowski2013-03-086-76/+337
|\ \ \ \ | |/ / / |/| | | SI-7006 Prevent unreachable blocks in GenICode
| * | | SI-7006 Prevent unreachable blocks in GenICodeJames Iry2013-03-066-76/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes GenICode prevent the generation of most unreachable blocks. The new unreachable block prevention code can be disabled with a compiler flag. Because full unreachable analysis is no longer necessary for normal code it makes the unreachable block analysis run only under -optimise. A test is included to make sure unreachable code doesn't cause issues in code gen. A concrete example will help. def foo(): X = { try return something() catch { case e: Throwable => println(e) throw e } unreachableCode() ] Here unreachableCode() is unreachable but GenICode would create ICode for it and then ASM would turn it into a pile of NOPS. A previous commit added a reachability analysis step to eliminate that unreachable code but that added a bit of time to the compilation process even when optimization was turned off. This commit avoids generating most unreachable ICode in the first place so that full reachability analysis is only needed after doing other optimization work. The new code works by extending a mechanism that was already in place. When GenICode encountered a THROW or RETURN it would put the current block into "ignore" mode so that no further instructions would be written into the block. However, that ignore mode flag was itself ignored when it came to figuring out if follow on blocks should be written. So this commit goes through places like try/catch and if/else and uses the ignore mode of the current block to decide whether to create follow on blocks, or if it already has, to kill by putting them into ignore mode and closing them where they'll be removed from the method's list of active blocks. It's not quite as good as full reachability analysis. In particular because a label def can be emitted before anything that jumps to it, this simple logic is forced to leave label defs alone and that means some of them may be unreachable without being removed. However, in practice it gets close the the benefit of reachability analysis at very nearly no cost.
* | | | Merge pull request #2204 from adriaanm/merge-2.10.xPaul Phillips2013-03-0616-84/+276
|\ \ \ \ | |/ / / |/| | | Merge 2.10.x into master
| * | | Merge 2.10.x into master.Adriaan Moors2013-03-058-84/+120
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resurrect some undead code from 373ded2ad3 (tuple2Pickler). Conflicts: src/compiler/scala/tools/nsc/interactive/CompilerControl.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * | Merge pull request #2199 from retronym/ticket/7214Adriaan Moors2013-03-051-0/+57
| | |\ \ | | | | | | | | | | SI-7214 outer check based on dealiased pattern type.
| | * \ \ Merge pull request #2156 from vigdorchik/hierarchyAdriaan Moors2013-03-056-84/+106
| | |\ \ \ | | | | | | | | | | | | SI-7109 SI-7153 Generalize the API to get docComments: allow to force do...
| | | * | | SI-7109 SI-7153 Generalize the API to get docComments: allow to force docTreesEugene Vigdorchik2013-02-246-84/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for given fragments. Don't type-check when forcing doc comments, but rather do it directly. Test the new functionality as well as better tests for the old one.
| | * | | | Merge pull request #2193 from adriaanm/patmat-refactorAdriaan Moors2013-03-056-63/+25
| | |\ \ \ \ | | | | | | | | | | | | | | merge 2.10.1 into 2.10.x
| | | * \ \ \ Merge 2.10.1 into 2.10.xAdriaan Moors2013-03-034-63/+11
| | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for SI-7183 in 440bf0a8c2 was forward ported in f73d50f46c. Conflicts: src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
| | | | * | | | [nomaster] SI-7195 minor version mustn't introduce warningsAdriaan Moors2013-03-013-63/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want 2.10.1 to be a drop-in replacement for 2.10.0, so we can't start warning where we weren't warning in 2.10.0. See SI-5954 (#1882, #2079) for when it was an implementation restriction, which was then weakened to a warning. It's now hidden behind -Ydebug.
| | | | * | | | Merge pull request #2168 from retronym/ticket/7183Adriaan Moors2013-03-012-0/+14
| | | | |\ \ \ \ | | | | | | | | | | | | | | | | | | SI-7183 Disable unreachability for withFilter matches.
| | | | | * | | | SI-7183 Disable unreachability for withFilter matches.Jason Zaugg2013-02-252-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids spurious unreachable warnings on code that the user didn't write. The parser desugars for-comprehensions such as: for (A(a) <- List(new A)) yield a To: List(new A()).withFilter(((check$ifrefutable$2) => check$ifrefutable$2: @scala.unhecked match { case A((a @ _)) => true case _ => false }) ) But, if `A.unapply` returns `Some[_]`, the last case is dead code. (Matching against a regular case class *would* fall through in the caes of a null scrutinee.) In SI-6902, we enabled unreachability warnings, even if the scrutinee was annotated as @unchecked. That was consistent with the 2.9.2 behaviour, it was only disabled temporarily (actually, accidentally) in 2.10.0. But, the old pattern matcher didn't warn about this code. This commit makes the pattern matcher recognise the special scrutinee based on its name and disables both exhaustivity *and* unreachability analysis. To do so, the we generalize the boolean flag `unchecked` to the class `Suppression`.
| | | * | | | | | [port] SI-7183 Disable unreachability for withFilter matches.Adriaan Moors2013-03-032-0/+14
| | | | |_|_|_|/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a forward port of #2168 (originally for 2.10.1, but the pattern matcher has since been refactored in 2.10.x.)
| * | | | | | | Merge 2.10.x into master.Adriaan Moors2013-03-051-0/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/library/scala/collection/mutable/ArrayOps.scala