summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'scala/2.10.x'Grzegorz Kossakowski2013-08-2938-3/+353
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the merge, the test/run/t7733 started to fail on Jenkins. I tried to reproduce it locally but I couldn't so I think it's system dependent failure. Per @retronym's suggestion I moved it to pending to not block the whole merge. Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala src/compiler/scala/tools/nsc/typechecker/Macros.scala src/compiler/scala/tools/nsc/typechecker/Namers.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/util/MsilClassPath.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/reflect/scala/reflect/internal/ClassfileConstants.scala src/reflect/scala/reflect/internal/Importers.scala src/reflect/scala/reflect/internal/Trees.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala test/files/run/macro-duplicate/Impls_Macros_1.scala test/files/run/t6392b.check test/files/run/t7331c.check
| * Merge pull request #2860 from retronym/merge/2.10.2-to-2.10.xJames Iry2013-08-2614-0/+85
| |\ | | | | | | Merge/2.10.2 to 2.10.x
| | * SI-7486 More tests for cycles triggered by implicit searchJason Zaugg2013-08-212-0/+8
| | | | | | | | | | | | | | | | | | | | | Moved an existing test from `pending` to `pos`. Not sure why it was moved to `pending` in the first place. Adds a new test distilled from building Scalaz with 2.10.3-RC1.
| | * Merge remote-tracking branch 'origin/2.10.2' into merge/2.10.2-to-2.10.xJason Zaugg2013-08-2114-0/+77
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Better late than never. Conflicts: src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
| * | | SI-942 A test case, five years adrift.Jason Zaugg2013-08-234-0/+17
| |/ / | | | | | | | | | | | | | | | | | | I'm looking at the changes made in 47f35b587, which prevented cyclic errors in class file parsing. That fix is insufficient for, or otherwise complicit in, SI-7778, for which I've enclosed a pending test.
| * | Merge pull request #2838 from retronym/ticket/7716v2.10.3-RC1James Iry2013-08-161-0/+16
| |\ \ | | | | | | | | SI-7716 Exclude patmat synthetics from bounds checking
| | * | SI-7716 Exclude patmat synthetics from bounds checkingJason Zaugg2013-08-161-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this pattern match translation, that occurs *before* refchecks: scala> val e: java.lang.Enum[_] = java.util.concurrent.TimeUnit.SECONDS scala> e match { case x => x } <console>:9: error: type arguments [_$1] do not conform to class Enum's type parameter bounds [E <: Enum[E]] e match { case x => x } ^ [[syntax trees at end of refchecks]] // <console> package $line5 { case <synthetic> val x1: Enum[_$1] = $line3.$read.$iw.$iw.e; case4(){ matchEnd3(x1) }; matchEnd3(x: Enum[_$1]){ x } RefChecks turns a blind eye to the non-conformant type `Enum[_$1]` in the label defs because of `65340ed4ad2e`. (Incidentally, that is far too broad, as I've noted in SI-7756.) This commit extends this exception to cover the synthetic ValDef `x1`. Commit log watchers might notice the similarities to SI-7694.
| * | | Merge pull request #2814 from xeno-by/topic/auto-duplicate-expansionsJames Iry2013-08-167-0/+57
| |\ \ \ | | |/ / | |/| | [nomaster] macro expansions are now auto-duplicated
| | * | [nomaster] macro expansions are now auto-duplicatedEugene Burmako2013-08-147-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix still requires macro developers to be careful about sharing trees by references, because attributed DefTrees will still bring trouble. However this is an improvement, because it doesn't make matters worse and automatically fixes situations similar to one in the test. A much more thorough discussion with a number of open questions left: http://groups.google.com/group/scala-internals/browse_thread/thread/492560d941b315cc Was fixed ages ago in master in one of the paradise backports. Never got to 2.10.x, but it's very useful, so I'm backporting it now.
| * | | SI-7752 Don't disambiguate type parameters of overloaded altsJason Zaugg2013-08-152-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are passed through from `InferencerContextErrors#applyErrorMsg` to `withDisambiguation` as the `locals` parameter, which is promptly ignored. This looks to be an unintended change in 39938bcc299. Without this patch, the enclosed test case enters a pathalogical disambiguation session, that not only flirts with unpleasant big-O complexities, but also flails about appending "(in method foo)" only to find that *all* occurences of the same-named type parameter come from some method named "foo". [snipping error message 40 seconds in the making] method foo), O(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), P(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), Q(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), R(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), S(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), T, U(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), V) cannot be applied to (Int) foo((1))
| * | | Merge pull request #2829 from adriaanm/ticket-7014James Iry2013-08-143-0/+21
| |\ \ \ | | | | | | | | | | SI-7014 Annot arg may refer to annotated class's member
| | * | | SI-7014 Annot arg may refer to annotated class's memberAdriaan Moors2013-08-133-0/+21
| | | | | | | | | | | | | | | | | | | | This only reduces the crasher to a warning.
| * | | | Merge pull request #2828 from adriaanm/rebase-2771James Iry2013-08-132-0/+47
| |\ \ \ \ | | | | | | | | | | | | [Rebase #2771] SI-7694 @uncheckedBounds, an opt-out from type bounds checking
| | * | | | SI-7694 Add @uncheckedBounds to the libraryJason Zaugg2013-08-132-0/+47
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to the previous commit that added the compiler support for opting out of bounds checking. With both pieces, we can test that the temporaries introduced by the named/default arguments transform don't trigger bounds violations.
| * | | | Merge pull request #2826 from retronym/ticket/7020-2.10.xAdriaan Moors2013-08-133-0/+48
| |\ \ \ \ | | |/ / / | |/| | | SI-7020 Determinism for pattern matcher warnings
| | * | | SI-7020 Determinism for pattern matcher warningsJason Zaugg2013-08-133-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use LinkedHashSet for the DPLL algorithm for determistic counter example generation. Before, the test compiled with: [info] v2.10.2 => /Users/jason/usr/scala-v2.10.2-0-g60d462e test/files/neg/t7020.scala:3: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List(_, _) List(5) match { ^ test/files/neg/t7020.scala:10: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List(_, _) List(5) match { ^ test/files/neg/t7020.scala:17: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(??, _) List(5) match { ^ test/files/neg/t7020.scala:24: warning: match may not be exhaustive. It would fail on the following input: List(_, _) List(5) match { ^
| * | | | Merge pull request #2809 from xeno-by/ticket/7733James Iry2013-08-133-0/+15
| |\ \ \ \ | | |/ / / | |/| | | SI-7733 reflective packages now more consistent with scalac
| | * | | [nomaster] SI-7733 reflective packages now more consistent with scalacEugene Burmako2013-08-133-0/+15
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously PackageScopes from scala.reflect ignored all classes that had $'s in non-rightmost positions in their names. Unfortunately this behaviour is inconsistent with how scalac does things, and I reconciled this as usual, by pulling corresponding logic into scala-reflect.jar and sharing it between runtime reflection and compiler. This change has seprate pull requests for 2.10.x and 2.11.0. The latter deprecates `scala.tools.nsc.util.ClassPath.isTraitImplementation` whereas the former (which you're looking at right now) does not, because we can't deprecated members in minor releases.
| * | | Merge pull request #2813 from xeno-by/topic/showrawGrzegorz Kossakowski2013-08-121-1/+1
| |\ \ \ | | | | | | | | | | showRaw now prints symbols of def trees
| | * | | showRaw now prints symbols of def treesEugene Burmako2013-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | A very useful addition that came in handy when hacking macro annotations
| * | | | Merge pull request #2817 from xeno-by/topic/toolbox-current-run-compilesJason Zaugg2013-08-122-0/+30
| |\ \ \ \ | | | | | | | | | | | | currentRun.compiles now correctly works in toolboxes
| | * | | | currentRun.compiles now correctly works in toolboxesEugene Burmako2013-08-102-0/+30
| | | |/ / | | |/| | | | | | | | | | | | Another random bug uncovered and extinguished when hacking macro annots.
| * / | | [nomaster] macro errors now always have positionsEugene Burmako2013-08-106-0/+35
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back then when I implemented macros for inclusion in trunk (Spring 2012), partest didn't support the _1, _2, ... convention for neg tests, so I had to use toolboxes to test macro-generated exceptions. Unfortunately toolboxes aren't very good with positions (mostly because their inputs are almost always constructed without corresponding sources) so I didn't notice that errors signalizing about macro-generated exceptions actually don't carry positions with them because of a typo. This patch fixes the oversight, but it doesn't need to be ported to master, because over there everything's already fixed by one of the backports from macro paradise.
| * | | SI-7331 tb.parse returns unpositioned treesDen Shabalin2013-08-086-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit gets rid off code wrapping that was previously used by toolbox to get into correct parsing mode. Instead combination of templateStats/accept(EOF) is used. This is the same solution as the one used in repl and built-in scriptRunner This pull request doesn't attempt to generalize this approach in any way and re-use it all over the place due to the caution of possible accidental compatibility breakage. I plan to do it separately against master. Additionally there are a few more changes that make importers be aware of positions and a test for that (via @jedesah).
| * | | Merge pull request #2761 from scalamacros/ticket/7510Jason Zaugg2013-08-015-1/+38
| |\ \ \ | | | | | | | | | | Assorted toolbox fixes
| | * | | brings JavaMirrors up to speed with ClassfileParserEugene Burmako2013-07-235-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently there are still discrepancies between how the vanilla compiler turns class files into symbols and how the reflective compiler does it. Working on bringing these guys in sync, one bug at a time.
* | | | | Merge pull request #2852 from retronym/ticket/1980-warningAdriaan Moors2013-08-213-0/+22
|\ \ \ \ \ | | | | | | | | | | | | SI-1980 A lint warning for by-name parameters in right assoc methods
| * | | | | SI-1980 A lint warning for by-name parameters in right assoc methodsJason Zaugg2013-08-193-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The desugaring of right associative calls happens in the parser. This eagerly evaluates the arguments (to preserve left-to-right evaluation order the arguments are evaluated before the qualifier). This is pretty surprising if the method being called has a by-name parameter in the first parameter section. This commit adds a warning under -Xlint when defining such a method. The relevent spec snippets: > SLS 4.6.1 says that call-by-name argument "is not evaluated at the point of function application, but instead is evaluated at each use within the function". > > But 6.12.3 offers: > "If op is right- associative, the same operation is interpreted as { val x=e1; e2.op(x ) }, where x is a fresh name."
* | | | | | Merge pull request #2810 from xeno-by/topic/compile-time-onlyAdriaan Moors2013-08-214-0/+128
|\ \ \ \ \ \ | | | | | | | | | | | | | | @compileTimeOnly: moved to scala-library.jar, got some fixes
| * | | | | | @compileTimeOnly now works for symbols from the empty packageEugene Burmako2013-08-151-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks like we've got the entire language covered now.
| * | | | | | @compileTimeOnly now works for annotationsEugene Burmako2013-08-151-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://docs.scala-lang.org/overviews/macros/annotations.html say sincere "thank you!".
| * | | | | | marks Expr.splice and Expr.value with @compileTimeOnlyEugene Burmako2013-08-152-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that @compileTimeOnly is part of the standard library, why don't we use it within the standard library.
| * | | | | | moves compileTimeOnly to scala-libraryEugene Burmako2013-08-142-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the notion that's come to be universally useful, so I suggest we promote it to be universally accessible. Note that the attached test incorrectly fails to report errors for definitions coming from the empty package and for annotations. These are bugs, and they are fixed in subsequent commits of this pull request.
* | | | | | | Move partest to https://github.com/scala/scala-partestAdriaan Moors2013-08-2030-614/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As partest is now resolved from maven, `test/partest` uses `ant test.suite.init` to determine the classpath (serialized to build/pack/partest.properties) that's necessary to run `scala.tools.partest.nest.ConsoleRunner`. Thus, partest gets exactly the same classpath, whether run from the command line through `test/partest` or via `ant test`. The version of partest we're using is specified by properties defined in versions.properties (formerly `starr.number`). Currently, we're using: ``` scala.binary.version=2.11.0-M4 partest.version.number=1.0-RC3 ``` NOTES: - The version of Scala being tested must be backwards binary compatible with the version of Scala that was used to compile partest. - Once 2.11 goes final, `scala.binary.version=2.11`, and `starr.version=2.11.0`. - Need scalacheck on classpath for test/partest scalacheck tests. - Removed atrophied ant tests (haven't been run/changed for at least two years I checked 81d659141a as a "random" sample). - Removed scalacheck. It's resolved as a partest dependency. - For now, use a locally built scalap - Kept the trace macro in the main repo (partest-extras) - New targets for faster pr validation: test-core-opt, test-stab-opt - Reused partest eclipse/intellij project to partest-extras (note: the partest dependency is hard-coded)
* | | | | | | Merge pull request #2824 from qerub/ticket/7740Adriaan Moors2013-08-201-0/+33
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7740 Trim stack trace before printing in REPL
| * | | | | | | SI-7740 Trim stack trace before printing in REPLChristoffer Sawicki2013-08-191-0/+33
| | | | | | | |
* | | | | | | | Merge branch 'master' into patmatPaul Phillips2013-08-2015-10/+55
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
| * | | | | | | Merge pull request #2853 from retronym/ticket/6797Adriaan Moors2013-08-191-0/+4
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6797 Test case for already-fixed DelayedInit bug
| | * | | | | | | SI-6797 Test case for already-fixed DelayedInit bugJason Zaugg2013-08-191-0/+4
| | | |/ / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Progressed in b4fbb7be0e2, "translation for DelayedInit keeps more code in original class."
| * | | | | | | Merge pull request #2840 from retronym/ticket/7756-2.11Adriaan Moors2013-08-195-0/+30
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7756 Uncripple refchecks in case bodies
| | * | | | | | | SI-7756 Uncripple refchecks in case bodiesJason Zaugg2013-08-165-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 65340ed4ad2e, parts of RefChecks were disabled when we traversed into the results of the new pattern matcher. Similar logic existed for the old pattern matcher, but in that case the Match / CaseDef nodes still existed in the tree. The new approach was too broad: important checks no longer scrutinized the body of cases. This commit turns the checks back on when it finds the remnants of a case body, which appears as an application to a label def.
| * | | | | | | | Merge pull request #2854 from som-snytt/issue/7729-slashAdriaan Moors2013-08-195-10/+10
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7729 Fix broken windows build
| | * | | | | | | | SI-7729 Fix broken windows buildSom Snytt2013-08-195-10/+10
| | | |/ / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixing #ifdiff uncovered a latent bug in partest when it detects paths to normalize in test log output. It would not normalize file separators for test names with non-word characters. This commit normalizes the test name to the ticket number as a workaround until the next partest version is picked up. It also fixes partest in this repo in case we've not yet switched over to the new repo. A separate PR will be submitted to the new repo as necessary.
| * | | | | | | | Merge pull request #2839 from densh/topic/si-7757Adriaan Moors2013-08-194-0/+11
| |\ \ \ \ \ \ \ \ | | |/ / / / / / / | |/| | | | | | | SI-7757 disallow constructor annotations on traits
| | * | | | | | | SI-7757 add additional test case with annotation on the next lineDen Shabalin2013-08-165-4/+10
| | | | | | | | |
| | * | | | | | | SI-7757 disallow constructor annotations on traitsDen Shabalin2013-08-162-0/+5
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it was possible to define constructor annotations on traits with really weird side-effects (parser lost the body of the trait). Now constructor annotations on traits will cause appropriate syntax errors.
* | | | | | | | Refinement of name-based unapplySeq.Paul Phillips2013-08-182-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Can't finnesse the drop method. Call it blindly for now, even though in the long run you won't have to write drop.
* | | | | | | | An unapplySeq-via-String test.Paul Phillips2013-08-182-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a lot of details yet to be ironed out when it comes to sequences, but at least here's a little evidence that the basic mechanisms work.
* | | | | | | | Refined name-based patmat methods.Paul Phillips2013-08-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fleshes out some of the slightly unfinished corners of the adventure, especially for unapplySeq. There's still an unhealthy amount of duplication and a paucity of specification, but I think it's in eminently good shape for a milestone.
* | | | | | | | Revert "Minor improvement in pattern typer inference."Paul Phillips2013-08-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 35122d6cda84bb2df69ca51c6b1b80e61693bf6f. It also includes a test case embodying the reversion reason: the test case no longer compiled. Parties interested in the surrounding details may want to look at SI-7472.