summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* SI-6969, mishandling of SoftReferences in method cache.Paul Phillips2013-01-242-0/+29
| | | | | | | | | More interesting to test than it was to fix. The soft reference is now dereferenced once, the locally stored underlying value ascertained to be non-null, and the remainder of the references to the value use the local var. The enclosed test reliably NPEs without this patch.
* Merge pull request #1952 from retronym/backport/1599Paul Phillips2013-01-242-0/+9
|\ | | | | [backport] Fix SI-6637 (misoptimization in erasure)
| * [backport] Fix SI-6637 (misoptimization in erasure)Jason Zaugg2013-01-232-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | commit f9ef5300ab561628e53c654df9000c75f488d74a Author: Jan Niehusmann <jan@gondor.com> Date: Fri Nov 9 15:05:58 2012 +0100 Fix SI-6637 (misoptimization in erasure) Move the optimization one level deeper so the expression being tested with isInstanceOf is always evaluated. (cherry picked from commit b540aaee4ba30e2dd980456a44e8c6d732222df1)
* | Merge pull request #1953 from retronym/backport/1586Paul Phillips2013-01-241-0/+61
|\ \ | | | | | | [backport] Fix unsafe array opt. / opt. primitive Array(...)
| * | [backport] Fix unsafe array opt. / opt. primitive Array(...)Jason Zaugg2013-01-231-0/+61
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-6611, SI-6247 (partial fix) The original commits on master were a bit circuitous, this is squashed to a neat little package. I had to add type arguments to the Array.apply calls in the test case, they are inferred on master. commit 41ff05dfdbcf032157b3509ace633f2e7a12295c Author: Jason Zaugg <jzaugg@gmail.com> Date: Sun Nov 4 14:44:59 2012 +0100 Refactor guards checking for a particular overload of Array.apply. (cherry picked from commit 092345a24c22a821204fb358d33272ae8f7353be) commit 1e5c942deccaf64f8d57bd8891b912381d7f220a Author: Jason Zaugg <jzaugg@gmail.com> Date: Sun Nov 4 14:17:25 2012 +0100 Expand optimization of Array(e1, ..., en) to primitive arrays. (cherry picked from commit 8265175ecc42293997d59049f430396c77a2b891) commit ab1bf77e39f2dfeacf3fc107ccb2907a1867f04c Author: Jason Zaugg <jzaugg@gmail.com> Date: Sat Nov 3 13:34:20 2012 +0100 SI-6611 Tighten up an unsafe array optimization The net was cast too wide and was unsafely optimizing away array copies. (cherry picked from commit dad886659faca4fba2d4937c9bc6780591b02c27) And also: Optimize primitive Array(e1, ..., en) Expands an existing optimization for reference arrays to apply to primitives, as well. Fixes one aspect of SI-6247. (cherry picked from commit cac5a08611f9511ba4d94b99db630404efae190a) Conflicts: src/compiler/scala/tools/nsc/transform/CleanUp.scala More principled tree copying. Canonical > home-spun. Conflicts: src/compiler/scala/tools/nsc/transform/CleanUp.scala
* | Merge pull request #1929 from retronym/ticket/6439Paul Phillips2013-01-242-0/+88
|\ \ | | | | | | SI-6439 Avoid spurious REPL warnings about companionship
| * | SI-6439 Avoid spurious REPL warnings about companionshipJason Zaugg2013-01-192-0/+88
| |/ | | | | | | | | | | | | | | | | | | | | | | `val m` isn't a companion of `trait m`, check the pair of eponymous symbols are a ((class|trait), object) pair before emitting the warning. In order to correctly check this one a type alias is involved, `definedSymbols` must avoid normalizing through type aliases. AFAICT this is an improvement to the other clients of that Map, one such power mode progression is demonstrated at the end of the test case.
* | Fix broken build.Paul Phillips2013-01-241-1/+1
| | | | | | | | It's all system admin, all the time, here at scala ranch.
* | SI-6434 Pretty print function types with by name arg as (=> A) => BJames Iry2013-01-232-0/+18
|/ | | | | | | | | We were pretty printing a function type with one by name arg as => A => B, but because => is right associative that's formally equivalent to => (A => B) and that's entirely a different thing. This commit changes the pretty printer in Typers.scala to check for a byname argument on a function type and wrap it in parens. A REPL test is included.
* Merge pull request #1904 from JamesIry/SI-5568_2.10.xGrzegorz Kossakowski2013-01-182-0/+25
|\ | | | | SI-5568 Fixes verify error from getClass on refinement of value type
| * SI-5568 Comment improvements for getClass on primitive intersection.James Iry2013-01-151-2/+0
| | | | | | | | | | Based on code review here are a few comment cleanups and the removal of some dead test code.
| * SI-5568 Fixes verify error from getClass on refinement of value typeJames Iry2013-01-152-0/+27
| | | | | | | | | | | | | | | | ().asInstanceOf[AnyRef with Unit].getClass and 5.asInstanceOf[AnyRef with Int].getClass would cause a verify error. Going the other way, i.e. [Unit with AnyRef] or [Int with AnyRef] worked fine. This commit fixes it that both directions work out to BoxedUnit or java.lang.Integer.
* | SI-6956 determine switchability by type, not treeAdriaan Moors2013-01-152-0/+27
|/ | | | | | | | | Constant folding will set the type of a constant tree to `ConstantType(Constant(folded))`, while the tree itself can be many different things (in casu, an Ident). We used to look at the tree directly when deciding whether to emit a switch. Now we look at the tree's type. VoilĂ .
* Merge pull request #1879 from adriaanm/ticket-6955Paul Phillips2013-01-152-0/+27
|\ | | | | SI-6955 switch emission no longer foiled by type alias
| * SI-6955 switch emission no longer foiled by type aliasAdriaan Moors2013-01-102-0/+27
| | | | | | | | | | dealias the type of the scrutinee before checking it's switchable now with tests! (using IcodeTest since javap is not available everywhere)
* | SI-6126 Test case for varargs of tagged primitives.Jason Zaugg2013-01-131-0/+8
| | | | | | | | | | This started working after the merge fe1110f. I didn't track down precisely which commit was responsible beyond that.
* | Merge pull request #1869 from retronym/backport/1826Paul Phillips2013-01-1113-70/+70
|\ \ | | | | | | Backport of SI-6846.
| * | Backport of SI-6846.Jason Zaugg2013-01-0813-70/+70
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 55806cc0e6177820c12a35a18b4f2a12dc07bb39 Author: Paul Phillips <paulp@improving.org> Date: Wed Dec 19 07:32:19 2012 -0800 SI-6846, regression in type constructor inference. In 658ba1b4e6 some inference was gained and some was lost. In this commit we regain what was lost and gain even more. Dealiasing and widening should be fully handled now, as illustrated by the test case. (cherry picked from commit dbebcd509e4013ce02655a2687b27d0967b3650e) commit e6ef58447d0f4ef6de956fcc03ee283bb9028c02 Author: Paul Phillips <paulp@improving.org> Date: Fri Dec 21 15:11:29 2012 -0800 Cleaning up type alias usage. I determined that many if not most of the calls to .normalize have no intent beyond dealiasing the type. In light of this I went call site to call site knocking on doors and asking why exactly they were calling any of .normalize .widen.normalize .normalize.widen and if I didn't like their answers they found themselves introduced to 'dropAliasesAndSingleTypes', the recursive widener and dealiaser which I concluded is necessary after all. Discovered that the object called 'deAlias' actually depends upon calling 'normalize', not 'dealias'. Decided this was sufficient cause to rename it to 'normalizeAliases'. Created dealiasWiden and dealiasWidenChain. Dropped dropAliasesAndSingleTypes in favor of methods on Type alongside dealias and widen (Type#dealiasWiden). These should reduce the number of "hey, the type alias doesn't work" bugs. (cherry picked from commit 3bf51189f979eb0dd41744ca844fd12dfdaa0dee) Conflicts: src/compiler/scala/tools/nsc/interpreter/CompletionOutput.scala commit c1d8803cea1523f458730103386d8e14324a9446 Author: Paul Phillips <paulp@improving.org> Date: Sat Dec 22 08:13:48 2012 -0800 Shored up a hidden dealiasing dependency. Like the comment says: // This way typedNew always returns a dealiased type. This // used to happen by accident for instantiations without type // arguments due to ad hoc code in typedTypeConstructor, and // annotations depended on it (to the extent that they worked, // which they did not when given a parameterized type alias // which dealiased to an annotation.) typedTypeConstructor // dealiases nothing now, but it makes sense for a "new" to // always be given a dealiased type. PS: Simply running the test suite is becoming more difficult all the time. Running "ant test" includes time consuming activities of niche interest such as all the osgi tests, but test.suite manages to miss the continuations tests. (cherry picked from commit 422f461578ae0547181afe6d2c0c52ea1071d37b) commit da4748502792b260161baa10939554564c488051 Author: Paul Phillips <paulp@improving.org> Date: Fri Dec 21 12:39:02 2012 -0800 Fix and simplify typedTypeConstructor. Investigating the useful output of devWarning (-Xdev people, it's good for you) led back to this comment: "normalize to get rid of type aliases" You may know that this is not all the normalizing does. Normalizing also turns TypeRefs with unapplied arguments (type constructors) into PolyTypes. That means that when typedParentType would call typedTypeConstructor it would find its parent had morphed into a PolyType. Not that it noticed; it would blithely continue and unwittingly discard the type arguments by way of appliedType (which smoothly logged the incident, thank you appliedType.) The simplification of typedTypeConstructor: There was a whole complicated special treatment of AnyRef here which appears to have become unnecessary. Removed special treatment and lit a candle for regularity. Updated lots of tests regarding newly not-so-special AnyRef. (cherry picked from commit 394cc426c1ff1da53146679b4e2995ece52a133e) commit 1f3c77bacb2fbb3ba9e4ad0a8a733e0f9263b234 Author: Paul Phillips <paulp@improving.org> Date: Fri Dec 21 15:06:10 2012 -0800 Removed dead implementation. Another "attractive nuisance" burning off time until I realized it was commented out. (cherry picked from commit ed40f5cbdf35d09b02898e9c0950b9bd34c1f858)
* / SI-6928, VerifyError with self reference to super.Paul Phillips2013-01-072-0/+11
|/ | | | | | | | | A bug in typers mishandled varargs. We should get more aggressive about eliminating all the ad hoc parameter/argument handling code spread everywhere. For varargs especially: any code which tries to make an adjustment based on a repeated parameter is more likely to be wrong than right. In aggregate these reinventions are a huge source of bugs.
* Merge pull request #1840 from paulp/issue/6911Paul Phillips2013-01-063-69/+106
|\ | | | | SI-6911, regression in generated case class equality.
| * SI-6911, regression in generated case class equality.Paul Phillips2013-01-033-69/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | Caught out by the different semantics of isInstanceOf and pattern matching. trait K { case class CC(name: String) } object Foo extends K object Bar extends K Foo.CC("a") == Bar.CC("a") That expression is supposed to be false, and with this commit it is once again.
* | Merge pull request #1841 from adriaanm/rebase-6827-2.10.xAdriaan Moors2013-01-042-0/+46
|\ \ | | | | | | Fix Iterator#copyToArray (fixes SI-6827).
| * | Fix Iterator#copyToArray (fixes SI-6827).Erik Osheim2013-01-042-0/+46
| |/ | | | | | | | | | | | | | | | | | | | | | | | | As pointed out in #scala, when using a non-zero start it's possible to get an ArrayIndexOutOfBoundsException due to an incorrect bounds check. This patch fixes this, as well as another potential bounds error, and adds test cases. Incorporates some other suggestions by Som-Snytt to ensure that callers will get useful error messages in cases where the start parameter is wrong (negative or out-of-array-bounds). Review by @som-snytt.
* | Merge pull request #1739 from jedesah/Array_optPaul Phillips2013-01-042-0/+15
|\ \ | |/ |/| SI-5017 Poor performance of :+ operator on Arrays
| * SI-5017 Poor performance of :+ operator on ArraysJean-Remi Desjardins2012-12-232-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Control performance of :+ and +: operator on my machine were 700-800 ms After adding size hint on the implementation in SeqLike, it went down to 500-600 ms But with specialixed implementation in ArrayOps, brings it down to 300-400 ms Unfortunatly, this method will only be called when the Array object is being referenced directly as it's type, but that should be the case enough times to justify the extra method. I ended up removing the sizeHint in SeqLike because it made the execution of the "benchmark" slower when the Array was being manipulated as a Seq. Side note: Interestingly enough, the benchmark performed better on my virtualized Fedora 17 with JDK 7 than natively on Mac OS X with JDK 6
* | Merge pull request #1822 from paulp/issue/6194Paul Phillips2013-01-032-0/+9
|\ \ | | | | | | SI-6194, repl crash.
| * | SI-6194, repl crash.Paul Phillips2012-12-272-0/+9
| | | | | | | | | | | | | | | | | | Always a bad idea to use replaceAll on unknown strings, as we saw here when windows classpaths arrived containing escape-requiring backslashes.
* | | LinearSeq lengthCompare without an iterator.Paul Phillips2012-12-282-10/+16
| | | | | | | | | | | | | | | | | | | | | Had to fix up an iffy test: not only was it testing undefined behavior, it demanded just the right numbers be printed in a context where all negative or positive numbers are equivalent. It's the ol' "get them coming and going" trick.
* | | SI-6415, overly eager evaluation in Stream.Jean-Remi Desjardins2012-12-282-0/+34
|/ / | | | | | | | | | | | | The lengthCompare method in LinearSeqOptimized was looking one step further than it needed to in order to give the correct result, which was creating some unwanted side effects related to Streams.
* | Merge pull request #1727 from scalamacros/ticket/6548Paul Phillips2012-12-192-0/+14
|\ \ | |/ |/| SI-6548 reflection now correctly enters jinners
| * SI-6548 reflection now correctly enters jinnersEugene Burmako2012-12-072-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When completing Java classes, runtime reflection enumerates their fields, methods, constructors and inner classes, loads them and enters them into either the instance part (ClassSymbol) or the static part (ModuleSymbol). However unlike fields, methods and constructors, inner classes don't need to be entered explicitly - they are entered implicitly when being loaded. This patch fixes the double-enter problem, make sure that enter-on-load uses the correct owner, and also hardens jclassAsScala against double enters that can occur in a different scenario. Since the fix is about Java-compiled classes, the test needs *.class artifacts produced by javac. Therefore I updated javac-artifacts.jar to include the new artifacts along with their source code.
* | Merge pull request #1754 from retronym/ticket/6288Adriaan Moors2012-12-145-10/+239
|\ \ | | | | | | SI-6288 Perfecting positions
| * | Expand pattern match position tests.Jason Zaugg2012-12-122-11/+82
| | | | | | | | | | | | | | | | | | - Adds tests for unapplySeq and unapply: Boolean. Both seem to be well positioned after the previous changes.
| * | SI-6288 Remedy ill-positioned extractor binding.Jason Zaugg2012-12-122-11/+12
| | | | | | | | | | | | | | | | | | The call to `Option#get` on the result of the unapply method was unpositioned and ended up with the position of the `match`.
| * | SI-6288 Fix positioning of label jumpsJason Zaugg2012-12-122-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICode generation was assigning the position of the last label jump to all jumps to that particular label def. This problem is particularly annoying under the new pattern matcher: a breakpoint in the body of the final case will be triggered on the way out of the body of any other case. Thanks to @dragos for the expert guidance as we wended our way through GenICode to the troublesome code. Chalk up another bug for mutability. I believe that the ICode output should be stable enough to use a a .check file, if it proves otherwise we should make it so.
| * | SI-6288 Position argument of unapplyJason Zaugg2012-12-112-0/+55
| | | | | | | | | | | | | | | | | | | | | `atPos(pos) { ... }` doesn't descend into children of already positioned trees, we need to manually set the position of `CODE.REF(binder)` to that of the stunt double `Ident(nme.SELECTOR_DUMMY)`.
* | | Merge pull request #1737 from retronym/ticket/6555Adriaan Moors2012-12-112-0/+37
|\ \ \ | | | | | | | | SI-6555 Better parameter name retention
| * | | SI-6555 Better parameter name retentionJason Zaugg2012-12-082-0/+37
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were losing track of parameter names in two places: 1. Uncurry was using fresh names for the apply method parameters during Function expansion. (The parameter names in the tree were actually correct, they just had synthetic symbols with "x$1" etc.) 2. When adding specialized overrides, the parameter names of the overriden method were used, rather than the parameter names from the overriding method in the class to which we are adding methods. The upshot of this is that when you're stopped in the debugger in the body of, say, `(i: Int) => i * i`, you see `v1` rather than `i`. This commit changes Uncurry and SpecializeTypes to remedy this.
* | | Merge pull request #1752 from scalamacros/ticket/5841Adriaan Moors2012-12-1114-0/+132
|\ \ \ | | | | | | | | Ticket/5841
| * | | SI-5841 reification of renamed importsAndriy Polishchuk2012-12-1114-0/+132
| |/ / | | | | | | | | | | | | | | | Reification of renamed imports is done by catching Selects with name != their tree.symbol.name, replacing this name with tree.symbol.name, and then doing reifyProduct in case of renamed terms and reifyBoundType (inner) in case of renamed types.
* | | Merge pull request #1733 from retronym/ticket/6614Adriaan Moors2012-12-102-0/+19
|\ \ \ | | | | | | | | SI-6614 Test case for fixed ArrayStack misconduct.
| * | | SI-6614 Test case for fixed ArrayStack misconduct.Jason Zaugg2012-12-082-0/+19
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not sure when it was fixed, but in 2.9.2 things were messed up: scala> (for (i <- 0 to 10) yield { val in = ArrayStack.tabulate(i)(_.toString); (in, (in filter (_ => true)) == in) }).mkString("\n") res14: String = (ArrayStack(),true) (ArrayStack(0),true) (ArrayStack(0, 1),true) (ArrayStack(1, 2, null),false) (ArrayStack(0, 1, 2, 3),true) (ArrayStack(3, 4, null, null, null),false) (ArrayStack(2, 3, 4, 5, null, null),false) (ArrayStack(1, 2, 3, 4, 5, 6, null),false) (ArrayStack(0, 1, 2, 3, 4, 5, 6, 7),true) (ArrayStack(7, 8, null, null, null, null, null, null, null),false) (ArrayStack(6, 7, 8, 9, null, null, null, null, null, null),false)
* | | Merge pull request #1732 from retronym/ticket/6690Adriaan Moors2012-12-101-0/+62
|\ \ \ | | | | | | | | SI-6690 Release reference to last dequeued element.
| * | | SI-6690 Release reference to last dequeued element.Jason Zaugg2012-12-081-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoids leaks in MutableList and its more better known child, mutable.Queue, when the last element is dequeued or when we take the tail of a one element collection. Refactors copy/pasted code between the two implementations of tail.
* | | | Merge pull request #1729 from JamesIry/SI-5789-2_2.10.xAdriaan Moors2012-12-102-0/+28
|\ \ \ \ | | | | | | | | | | SI-5789 Removes assertion about implclass flag in Mixin.scala
| * | | | SI-5789 Use the ReplTest framework in the testJames Iry2012-12-072-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't check for the crashed message, just dump the output from the REPL. Use the ReplTest framework to the make the test clean
| * | | | SI-5789 Checks in the right version of the testJames Iry2012-12-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In my other commit I had a version of the test that didn't actually reproduce the problem because it didn't set the optimize flag
| * | | | SI-5789 Removes assertion about implclass flag in Mixin.scalaJames Iry2012-12-072-0/+30
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | The assertion that the class being mixed from should be an implclass seems reasonable, but the flag isn't always set. In order to stop the bleeding this fix turns the assertion into a debug warning. Issue SI-6782 will track figuring out the root cause of the missing flag.
* | | | Merge pull request #1713 from retronym/ticket/5894Adriaan Moors2012-12-101-0/+17
|\ \ \ \ | | | | | | | | | | SI-5894 Don't emit static forwarders for macros.
| * | | | SI-5894 Don't emit static forwarders for macros.Jason Zaugg2012-12-051-0/+17
| | |/ / | |/| |