summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* SI-7591 Move command-line spec usage demo to testsSimon Ochsenreither2013-07-011-0/+83
|
* Merge pull request #2681 from soc/SI-7590Adriaan Moors2013-06-282-1/+7
|\ | | | | SI-7590 TreeSet should fail fast if Ordering is null
| * SI-7590 TreeSet should fail fast if Ordering is nullSimon Ochsenreither2013-06-252-1/+7
| | | | | | | | | | | | | | | | | | | | While migrating scala.tools.nsc.util.TreeSet to scala.collection.mutable.TreeSet, I messed up initialization order and realized that TreeSet accepts null as an Ordering and only fails much later. This change makes mutable.TreeSet and immutable.TreeSet fail immediately.
* | SI-7344 Specialize methods in private scopesVlad Ureche2013-06-281-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performs method specialization inside a scope other than a {class, trait, object}: could be another method or a value. This specialization is much simpler, since there is no need to record the new members in the class signature, their signatures are only visible locally. It works according to the usual logic: - we use normalizeMember to create the specialized symbols - we leave DefDef stubs in the tree that are later filled in by tree duplication and adaptation The solution is limited by SI-7579: since the duplicator loses the sym annotations when duplicating, this expansion and rewiring can only take place in code that has not been subject to duplication. You can see the test case for an example. Review by @dragos, @paulp or @axel22.
* | Merge pull request #2678 from soc/SI-7600Adriaan Moors2013-06-273-2/+16
|\ \ | | | | | | SI-7600 [Avian] Skip tests r/stream_length and r/t4294
| * | SI-7600 [Avian] Skip tests r/stream_length and r/t4294Simon Ochsenreither2013-06-233-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue is that Avian's GC is currently not precise enough to determine the exact lifetime of each local/stack reference, and therefore considers the this reference to be reachable in situations where it could have been collected. This can cause issues (as seen in run/stream_length and run/t4294: `java.lang.OutOfMemoryError`) if code relies on the garbage collection of these values to keep memory consumption constant. This commit simply skips these two tests on Avian until the GC implementation is fixed.
* | | Merge pull request #2677 from jannic/SI-3936Adriaan Moors2013-06-273-0/+9
|\ \ \ | | | | | | | | SI-3936 - add test case to show that SI-3936 is already fixed
| * | | SI-3936 - add test case to show that SI-3936 is already fixedJan Niehusmann2013-06-233-0/+9
| |/ / | | | | | | | | | | | | These are exactly the examples given by Lukas Rytz in SI-3936. They fail with 2.10.1 and compile with 2.10.2 as well as current master.
* | | Merge pull request #2669 from adriaanm/modularize-parsingAdriaan Moors2013-06-275-5/+5
|\ \ \ | | | | | | | | Modularize parsing
| * | | Remove dependency on combinators from CommandLinerParser.Adriaan Moors2013-06-255-5/+5
| | |/ | |/| | | | | | | | | | | | | | | | tools.cmd.CommandLineParser uses a small hand-rolled parser TODO: replace partest's usage of scala.tools.nsc.util.CommandLine by scala.tools.cmd.CommandLine
* | | Merge pull request #2675 from soc/SI-7599Adriaan Moors2013-06-261-8/+12
|\ \ \ | | | | | | | | SI-7599 Modify methods to be non-tail-callable ...
| * | | SI-7599 [Avian] Prevent TCO in test to inspect stackSimon Ochsenreither2013-06-261-8/+12
| | |/ | |/| | | | | | | | | | This commit modifies methods in the test to be non-tail-callable to prevent Avian from eliding the stack frames we want to inspect.
* | | Merge pull request #2659 from retronym/ticket/7584Adriaan Moors2013-06-254-0/+32
|\ \ \ | |_|/ |/| | SI-7584 Fix typer regression with by-name parameter types
| * | SI-7584 Test and spurious warning fix for by-name closuresJason Zaugg2013-06-163-0/+21
| | | | | | | | | | | | | | | | | | The enclosed test case exercises by-name closures, which were the subject of the previous commit. In the process, a spurious warning was eliminated.
| * | SI-7584 Fix typer regression with by-name parameter typesJason Zaugg2013-06-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It regressed in fada1ef6b#L4L614. Partially reverting just this change restores the correct behaviour: ``` - if (sym.isStable && pre.isStable && !isByNameParamType(tree.tpe) && + if (treeInfo.admitsTypeSelection(tree) && ``` This patch embeds the check for by-name parameter types into `TreeInfo.isStableIdentifier`. That code already checks for `Symbol#isStable`, which exludes direct references to by-name parameters. But the additional check is required to deal with by-name parameters in function types, e.g `(=> Int) => Any`. Open question: should we go further and embed this check in `isStable`? Currently: final def isStable = isTerm && !isMutable && !(hasFlag(BYNAMEPARAM)) && (!isMethod || hasStableFlag) Such function types are an underspecified corner of the language, albeit one that is pretty useful writing, for example, in the signature of a lazy foldRight that can operate over infinite structures: def foldRight[A, B](fa: F[A], z: => B)(f: (A, => B) => B): B The next commit subjects them to a little testing.
* | | SI-7569 Fix end position in PostfixSelect treeFrançois Garillot2013-06-242-0/+31
| | | | | | | | | | | | | | | | | | | | | introduced in 5b54681: the end position of Postfix operators should take the operator length into account. review by @som-snytt
* | | Merge pull request #2653 from retronym/ticket/7433Grzegorz Kossakowski2013-06-232-0/+11
|\ \ \ | | | | | | | | SI-7433 Fix spurious warning about catching control throwable
| * | | SI-7433 Fix spurious warning about catching control throwableJason Zaugg2013-06-232-0/+11
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the same vein as SI-6994, we have to be careful not to warn about synthetic code. In that case, the spurious warnings came because we warned in the typechecker, which was also called in erasure. In this case, we are issuing the warning in Uncurry, so we must be mindful of the pattern matchers translations of non-trivial catch patterns, which look like: case (ex8 @ _) => { <synthetic> val x5: Throwable = ex8; case11(){ if ({ case14(){ if (x5.$isInstanceOf[NullPointerException]()) matchEnd13(true) else case15() }; case15(){ if (x5.$isInstanceOf[RuntimeException]()) matchEnd13(true) else case16() }; case16(){ matchEnd13(false) }; matchEnd13(x: Boolean){ x } }) This commit detects that `ex8` is synthetic and disables the warning.
* | | Merge pull request #2637 from retronym/ticket/7439Paul Phillips2013-06-234-0/+40
|\ \ \ | |_|/ |/| | SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols. …
| * | SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.Jason Zaugg2013-06-134-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `originalInfo` can return null for stub symbols; deal with that as we used to before a regression in 016bc3db. After this change, we can once again delete A_1.class and still compile code instantiating B_1. (A_1 is only referred to in a method signature of B_1 which is not called from our code.) scala> new B_1 warning: Class A_1 not found - continuing with a stub. res0: B_1 = B_1@5284b8f9 In practice, this situation arises when someone uses a third party class that was compiled against other libraries not avaialable on the current compilation classpath.
* | | SI-7292 Fixes test failures by updating *.check filesSimon Ochsenreither2013-06-214-13/+14
| | | | | | | | | | | | | | | Looks like partest's confusion about / vs. \ was fixed between the original Jenkins run of the fix for SI-7292 and its merge.
* | | Merge pull request #2342 from soc/SI-7292Adriaan Moors2013-06-206-0/+34
|\ \ \ | | | | | | | | SI-7292 Deprecate octal escape literals
| * | | SI-7292 Deprecate octal escape literalsSimon Ochsenreither2013-04-046-0/+34
| | | |
* | | | Merge pull request #2625 from paulp/pr/no-useless-implicitsGrzegorz Kossakowski2013-06-195-28/+29
|\ \ \ \ | | | | | | | | | | SI-6899, prohibit dangerous, useless implicit conversions.
| * | | | SI-6899, prohibit dangerous, useless implicit conversions.Paul Phillips2013-06-045-28/+29
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase eligibility requirements for implicit conversions, such that T => U is ineligible if T <: Null <or> AnyRef <: U This has the salutary effect of allowing us to ditch 16 ridiculous implicits from Predef, since they existed solely to work around the absence of this restriction. There was one tiny impact on actual source code (one line in one file) shown here, necessitated because the literal null is not eligible to be implicitly converted to A via <:<. def f[A](implicit ev: Null <:< A): A = null // before def f[A](implicit ev: Null <:< A): A = ev(null) // after As impositions go it's on the tame side.
* | | | Merge pull request #2628 from retronym/ticket/7364Eugene Burmako2013-06-194-0/+15
|\ \ \ \ | | | | | | | | | | SI-7364 Allow raw types in parent position in Java sources
| * | | | SI-7364 Allow raw types in parent position in Java sourcesJason Zaugg2013-06-094-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make this work, this commit simply restricts parent type argument inference to Scala source files. The surrounding code has also been refactored to avoid a var.
* | | | | Merge pull request #2635 from retronym/ticket/7151Grzegorz Kossakowski2013-06-192-0/+30
|\ \ \ \ \ | | | | | | | | | | | | SI-7151 Emit final in bytecode for final inner classes.
| * | | | | SI-7151 Emit final in bytecode for final inner classes.Jason Zaugg2013-06-072-0/+30
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we did before a regression in 18efdedfb / SI-5676. This commit tightens up the condition in which the FINAL modifier is omitted; it now *only* does this for the module classes of nested objects.
* | | | | Merge pull request #2631 from retronym/ticket/5022Grzegorz Kossakowski2013-06-193-2/+35
|\ \ \ \ \ | | | | | | | | | | | | SI-5022 Retain precise existentials through pattern matching
| * | | | | SI-5022 Retain precise existentials through pattern matchingJason Zaugg2013-06-053-2/+35
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the dawn of scalac's existentials, the typer widens existentials pt-s by substituting wildcard types in places of existential quantifiers. In this example: class ForSomeVsUnapply { def test { def makeWrap: Wrap = ??? def useRep[e](rep: (e, X[e])) = () val rep = makeWrap match { case Wrap(r) => r }; useRep(rep) // error } } the type of `r` is the result of typechecking: Apply( fun = TypeTree( tpe = (rep#12037: (e#12038, X#7041[e#12038]) forSome { type e#12038 }) args = Bind(r @ _) :: Nil } This descends to type the `Bind` with: pt = (e#12038, X#7041[e#12038]) forSome { type e#12038 } `dropExistential` clobbers that type to `Tuple2#1540[?, X#7041[?]]`, which doesn't express any relationship between the two instances of the wildcard type. `typedIdent` sort of reverses this with a call to `makeFullyDefined`, but only ends up with: pt = (Any#3330, X#7041[_1#12227]) forSome { type _1#12227; type e#12038 } I suspect that this existential dropping only makes sense outside of typechecking patterns. In pattern mode, type information flows from the expected type onwards to the body of the case; we must not lose precision in the types. For SIP-18 friendly existentials, one `dropExistential` is invertable with `makeFullyDefined`, so this hasn't been such a big problem. The error message improvement conferred by SI-4515 took a hit. That might be a good example to consider when reviewing this change: Does it tell us anything interesting about this `dropExistential` business?
* | | | | Merge pull request #2657 from gkossakowski/junit-masterGrzegorz Kossakowski2013-06-191-174/+0
|\ \ \ \ \ | | | | | | | | | | | | Merge JUnit support into master
| * | | | | Move WeakHashSetTest to junit tests.Grzegorz Kossakowski2013-06-161-174/+0
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | The WeakHashSetTest was written as unit test but put into partest's `run` category as we were missing direct unit testing support. That got fixed so moving the test now.
* | | | | Merge pull request #2602 from t3hnar/Duration.toCoarsestAdriaan Moors2013-06-181-0/+28
|\ \ \ \ \ | | | | | | | | | | | | Add Duration.toCoarsest method
| * | | | | Add Duration.toCoarsest methodYaroslav Klymko2013-06-101-0/+28
| | | | | |
* | | | | | Merge pull request #2561 from soc/SI-7479Adriaan Moors2013-06-183-2/+58
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-7479 Make test/files/run/tailcalls.scala pass on Avian
| * | | | | SI-7479 Make test/files/run/tailcalls.scala pass on AvianSimon Ochsenreither2013-06-102-1/+57
| | | | | | | | | | | | | | | | | | | | | | | | This commit modifies the test and check file to use the new diff filter.
| * | | | | SI-7479 Add avian option to partest's diff filter...Simon Ochsenreither2013-06-061-1/+1
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | ... so that the different results of the test on Avian can be specified in the check file.
* | | | | Merge branch '2.10.x' into topic/merge-v2.10.2-RC1-35-ga54d86b-to-masterJason Zaugg2013-06-1011-11/+3144
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/partest/scala/tools/partest/DirectTest.scala
| * \ \ \ \ Merge pull request #2616 from retronym/ticket/7505Jason Zaugg2013-06-091-0/+16
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-7505 Test case for pattern matcher + type alias bug
| | * | | | | SI-7505 Test case for pattern matcher + type alias bugJason Zaugg2013-06-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Progressed along with SI-7214 in acd74cae09.
| * | | | | | Merge pull request #2606 from JamesIry/2.10.x_classfile_52Jason Zaugg2013-06-094-11/+87
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Test for reading JDK 8 (classfile format 52) class files.
| | * | | | | | Refactor testing logic for only running under certain JDK versionsJames Iry2013-06-043-18/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had several tests designed to only run if the JDK version was at least some specified version. This commit refactors that common logic into DirectTest.
| | * | | | | | Test for reading JDK 8 (classfile format 52) class files.James Iry2013-05-292-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes a test for reading JDK 8 (classfile format 52) class files, in particular default (aka defender) methods. It uses ASM to generate an interface with default methods then exercises that interface from Scala. Surprisingly no changes are necessary to the Scala code base to support reading format 52 class files. Because the test can only run under JDK 8, the JDK version is checked and the expected output is synthesized for previous versions.
| * | | | | | | Merge pull request #2611 from retronym/ticket/6481Paul Phillips2013-06-082-0/+17
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6841 Fix bug at the intersection of DelayedInit and named args
| | * | | | | | | SI-6841 Fix bug at the intersection of DelayedInit and named argsJason Zaugg2013-05-302-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DelayedInit transformation analyses the constructor to partition regular initialization from calls to super constructors / trait initializers. It failed to find such super calls if they were nested in a Block, which can happens when using named or default arguments. This commit makes that code peer into Blocks to correctly partition the constructor statements. This change doesn't affect the result of run/t4680.scala, which was mentioned in nearby comments and which chronicles bugs with DelayedInit when used in inheritance hierarchies.
| * | | | | | | | Merge pull request #2629 from retronym/ticket/7558Paul Phillips2013-06-081-0/+9
| |\ \ \ \ \ \ \ \ | | |_|_|/ / / / / | |/| | | | | | | SI-7558 Fix capture of free local vars in toolbox compiler
| | * | | | | | | SI-7558 Fix capture of free local vars in toolbox compilerJason Zaugg2013-06-051-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was creating an `ObjectRef[<notype>]` because of a small bug in `capturedVariableType`.
| * | | | | | | | Merge pull request #2626 from retronym/ticket/7556Adriaan Moors2013-06-053-0/+3015
| |\ \ \ \ \ \ \ \ | | |/ / / / / / / | |/| | | | | | | SI-7556 Fix runtime reflection involving ScalaLongSignature
| | * | | | | | | SI-7556 Fix runtime reflection involving ScalaLongSignatureJason Zaugg2013-06-053-0/+3015
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala type information is stored in classfiles in encoded in a String in the ScalaSignature annotation. When it is too big for a single String, it is split into an array of Strings in a different annotation, ScalaLongSignature. The enclosed test, with a class containing 3000 methods, uses the latter. It exposes a bug in the way runtime reflection decodes that data. It must concatentate and *then* decode, rather that the other way around.