summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Test in quick mode for ant buildSom Snytt2013-11-231-1/+2
| | | | | | | Add a target `test.suite.quick`. Let test.quick depend only on init and quick.done, and load the task using the quick path (with non-core deps).
* Merge pull request #3162 from retronym/ticket/7985Jason Zaugg2013-11-222-0/+8
|\ | | | | SI-7985 Allow qualified type argument in patterns
| * SI-7985 Allow projection of lower-cased prefix as pattern type argJason Zaugg2013-11-191-0/+5
| | | | | | | | | | As per the last commit, tighten up the interpretation of a lower cased identifier meaning that we're looking at a type variable.
| * SI-7985 Allow qualified type argument in patternsJason Zaugg2013-11-191-0/+3
| | | | | | | | | | | | | | We were considering the lower case `s` in `case _: Array[scala.Int]` as a sign that we were dealing with a type variable pattern. Now, we only do this if a lookahead confirms the absence of a the `.`
* | Merge pull request #3138 from densh/pr/fresh-name-extractorJason Zaugg2013-11-222-7/+53
|\ \ | | | | | | Refactor out fresh name prefix extraction logic
| * | refactor out fresh name prefix extraction logicDen Shabalin2013-11-172-7/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. refactor out FreshNameExtractor out of Quasiquotes cake into SymbolTable (can’t put it outside due to the fact that names are path-dependent) 2. add optional parameter to the fresh name creator to cover additional qq$ prefix needed for quasiquotes 3. add unit tests
* | | Merge pull request #3152 from paulp/pr/deprecationsJason Zaugg2013-11-223-3/+3
|\ \ \ | | | | | | | | Removing deprecated code.
| * | | Removing deprecated code.Paul Phillips2013-11-183-3/+3
| | |/ | |/| | | | | | | | | | Code which has been deprecated since 2.10.0 and which allowed for straightforward removal.
* | | Merge pull request #3131 from densh/pr/deprecate-pair-and-tripleJason Zaugg2013-11-2246-288/+292
|\ \ \ | | | | | | | | Deprecate Pair and Triple
| * | | deprecate Pair and TripleDen Shabalin2013-11-2046-288/+292
| |/ /
* | | Merge pull request #3175 from retronym/ticket/6229Eugene Burmako2013-11-224-0/+20
|\ \ \ | | | | | | | | SI-6329 Graduation day for pending tests for tag materialization
| * | | SI-6329 Graduation day for pending tests for tag materializationJason Zaugg2013-11-214-0/+20
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two kids in the class or '6329 had to repeat the senior year, but with a little help from 76b92ef, they've finally graduated. Here's the class photo: commit 3e855661136bb6c530ef1d3a24dc83800e7f1134 Author: Eugene Burmako <xeno.by@gmail.com> Date: Thu Sep 6 22:19:56 2012 +0200 test suite for SI-6329 test/files/run/t6329_repl.check | 13 +++++++++++++ test/files/run/t6329_repl.scala | 8 ++++++++ test/files/run/t6329_repl_bug.check | 13 +++++++++++++ test/files/run/t6329_repl_bug.pending | 10 ++++++++++ test/files/run/t6329_vanilla.check | 2 ++ test/files/run/t6329_vanilla.scala | 4 ++++ test/files/run/t6329_vanilla_bug.check | 2 ++ test/files/run/t6329_vanilla_bug.pending | 7 +++++++ 8 files changed, 59 insertions(+)
* | | Merge pull request #3172 from retronym/ticket/7987Eugene Burmako2013-11-222-0/+18
|\ \ \ | | | | | | | | SI-7987 Test case for "macro not expanded" error with implicits
| * | | SI-7987 Test case for "macro not expanded" error with implicitsJason Zaugg2013-11-212-0/+18
| |/ / | | | | | | | | | | | | | | | Fixed, serendipitously, a handful of commits ago in 4a6882e772, "SI-7944 FOUND: stray undetermined type params in vicinity of implicits".
* | | Merge pull request #3173 from retronym/topic/classOf-type-applyGrzegorz Kossakowski2013-11-212-0/+7
|\ \ \ | | | | | | | | Handle TypeApply(fun, ...) for symbol-less funs
| * | | Handle TypeApply(fun, ...) for symbol-less funsJason Zaugg2013-11-212-0/+7
| |/ / | | | | | | | | | | | | | | | Such as class literals, as one could conjure in `classOf[Int][Int]` Before, this would crash with a `NullPointerException`
* / / Prepare upgrade to scalacheck 1.11.Adriaan Moors2013-11-207-31/+9
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our scalacheck tests now compile against 1.10.1 and 1.11.0. They pass on 1.10.1, but fail on 1.11.0. Once (that)[https://github.com/rickynils/scalacheck/issues/79]'s fixed, and 1.11.1 released, we should be able to upgrade to it by simply changing scalacheck.version.number in versions.properties. The changes are mostly removing dead code (e.g., consolereporter business). Of interest: the type ascription for `oneOf`. I haven't quite investigated, but something seems to have changed between 1.10.1 and 1.11.0 that caused a different overload to be picked without the type ascription. Probably not a scalac bug, just a scalacheck api change.
* | Merge pull request #3140 from skyluc/issue/completion-import-object-7280Jason Zaugg2013-11-1825-22/+937
|\ \ | | | | | | SI-7280 Scope completion not returning members provided by imports
| * | SI-7280 Scope completion not returning members provided by importsLuc Bourlier2013-11-153-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | Updates localeContext() to return the best context possible when there are none directly associated with the given position. It happens when an expression cannot be successfully typed, as no precise ContextTree covers the expression location, or if the position is not inside any expression. Adds corresponding tests
| * | Adds test cases for scope completionLuc Bourlier2013-11-1512-0/+707
| | |
| * | Test infrastructure for scope completionJason Zaugg2013-11-1510-22/+22
| | | | | | | | | | | | | | | Adds a new marker /*_*/ to trigger scope completion test. Original type completion test oracles update for the tweaked output
* | | Merge pull request #3136 from dotta/issue/si-7915Jason Zaugg2013-11-183-0/+28
|\ \ \ | | | | | | | | SI-7915 Corrected range positions created during default args expansion
| * | | SI-7915 Corrected range positions created during default args expansionMirco Dotta2013-11-153-0/+28
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tree created during expansion of default arguments contained trees with the wrong type of positions. Let's discuss this with an example. Below is the tree generated for the `foo` method in the test class included in this commit. Before this commit: ``` [54:94]def foo(): [58]Unit = <70:90>{ [70:79]<artifact> val qual$1: [70]Bar = [70:79][70:79][70:79]new [74:77]Bar(); [80]<artifact> val x$1: [80]Int = [80]qual$1.bar$default$1; <70:90><70:83>qual$1.bar([80]x$1) } ``` Now: ``` [54:99]def foo(): [58]Unit = <70:95>{ <70:84><artifact> val qual$1: [70]Bar = [70:84][70:84][70:84]new [74:77]Bar(); [85]<artifact> val x$1: [85]Int = [85]qual$1.bar$default$1; <70:95>[84:88]qual$1.bar([85]x$1) } ``` Here are the list of changes: * The synthetic `qual$1` has a transparent position, instead of a range position. * The new Select tree (i.e., `qual$1.bar`) should always have a range position, because `selected` (i.e., the called method) is always visible in the source (in fact, this is the whole point of the fix, we need a range position or hyperlinking request from the Scala IDE won't work). * The Block that contains the expanded default arguments is forced to have a transparent position, as it never exist in the original source. The tricky part of the fix is the position assigned to the new Select tree, which needs to respect the range position's invariants. In the specific case, we ought to make sure that range positions don't overlap. Therefore, the position assigned to the new Select tree is computed by intersecting the original Select position (i.e., `baseFun`'s position) and the original qualifier's position (i.e., `qual`'s position). If you take a closer look at the range positions assigned in the tree after this commit, you'll notice that the range position of the `qual$1`'s rhs (i.e., [70:84]), and `qual$1.bar` (i.e., [84:88]) might seem to overlap, because the former ends where the latter begins. However, this not the case because of the range position's invariant 2, which states: > Invariant 2: in a range position, start <= point < end Hence, the above two positions aren't overlapping as far as the compiler is concerned. One additional aspect (that may look like a detail) is that we make sure to never generate a position such that its start is after its end. This is why we take the position with the smallest end point. Furthermore, calling `withStart` would turn any position in a range position, which isn't desiderable in general (and, even worse, this can lead to generation of invalid positions - bad offsets - if the computation is performed on offset positions). Hence, the position's computation is only performed when both `baseFun` and `qual` positions are range positions. Indeed, I expect this to be always the case if the compiler is started with -Yrangepos.
* | | Merge pull request #3119 from Ichoran/issue/5263James Iry2013-11-182-0/+170
|\ \ \ | | | | | | | | New mutable hash map with Long keys: partially solves SI-5263 and is relevant to SI-6825.
| * | | New AnyRefMap fixes SI-5263 to the extent practical.Rex Kerr2013-11-181-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An open addressing hash map based on a similar scheme to mutable.LongMap. It delivers performance equivalent to Java's HashMap for pretty much all AnyRefs, plus it works nicely with Scala's collections. Revisions made sure that all return types in the public API are specified. Also switched to a leading-zeros method of calculating the initial mask (to save a few ns). Also edited out java.util comparison numbers and moved constants to companion.
| * | | New mutable hash map with Long keys: partially solves SI-5263 and is relevantRex Kerr2013-11-181-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to SI-6825. The hash map is based on an open addressing scheme that provides dramatically faster (mostly due to specialization) get and contains operations than either the standard Java HashMap or any of the existing Scala hash maps. It doesn't work well above 500,000,000 elements as the arrays cannot scale past 2^30 elements. Maps are not faster in general due to the lack of specialization of Function1[Long, V]. Revisions made sure that all return types in the public API are specified. Also switched to a leading-zeros method of calculating the initial mask (to save a few ns), and used an occasionally-more-efficient version of seekEntryOrOpen. Also edited out specific performance numbers and moved constants to companion.
* | | | Merge pull request #3135 from adriaanm/revive-xml-testsJames Iry2013-11-1815-0/+336
|\ \ \ \ | | | | | | | | | | Revived tests that once depended on xml
| * | | | Revived tests that once depended on xmlAdriaan Moors2013-11-1415-0/+336
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | I was a bit overzealous in moving stuff over to scala-xml in 9c50dd5274 These were all compiler tests that accidentally touched on xml. I've tried to delicately decouple them so they can roam the scalac pastures as intended.
* | | | Merge pull request #3141 from soc/SI-7961Adriaan Moors2013-11-172-8/+14
|\ \ \ \ | |_|_|/ |/| | | SI-7961 Fix false positive procedure warnings
| * | | SI-7961 Fix false positive procedure warningsSimon Ochsenreither2013-11-142-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Two issues are fixed in this commit: - `def foo: Unit` was detected as missing a return type - The warning was emitted for constructors, but `def this(...): Unit = ...` is not valid Scala syntax
* | | | Revert "temporarily disables run/reflection-sync-subtypes"Jason Zaugg2013-11-142-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 04e2dbb29830d0e511cdfa8c132a9fad91d657ed, by avoiding the ill-fated attempt to short-circuit the global reflection lock. I think we can do better performance wise, but lets at least get something correct to start with.
* | | | Merge pull request #3133 from adriaanm/merge-2.10Adriaan Moors2013-11-148-0/+81
|\ \ \ \ | |_|/ / |/| | | Merge 2.10
| * | | Merge commit '6045a05b83' into merge-2.10Adriaan Moors2013-11-133-0/+44
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: src/interactive/scala/tools/nsc/interactive/Global.scala
| | * | | Fix completion after application with implicit argumentsJason Zaugg2013-11-063-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `List(1, 2, 3).map(f).<ctrl-space>` now works; before the tree had the type `(bf: CanBuildFrom[...]):...` and did not contribute completions from the result type. This commit checks if the tree has an implicit method type, and typechecks it as a qualifier. That is enough to get to `adaptToImplicitMethod` in the type checker, infer the implicit arguments, and compute the final result type accordingly.
| | | | |
| | \ \ \
| *-. \ \ \ Merge commit '075f6f260c'; commit 'e09a8a2b7f' into merge-2.10Adriaan Moors2013-11-135-0/+37
| |\ \ \ \ \ | | |_|_|/ / | |/| | | |
| | | * | | SI-4012 Mixin and specialization work wellVlad Ureche2013-11-052-0/+22
| | | |/ / | | | | | | | | | | | | | | | The bug was fixed along with SI-7638 in 504b5f3.
| | * / / SI-6546 InnerClasses attribute refers to absent classPaul Phillips2013-11-043-0/+15
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At issue is that the optimizer would eliminate closure classes completely, then neglect to eliminate those classes from the container's InnerClasses attribute. This breaks tooling which expects those entries to correspond to real classes. The code change is essentially mgarcia's - I minimized it and put the caches in perRunCaches, and added the test case which verifies that after being compiled under -optimise, there are no inner classes. Before/after: 7,8d6 < InnerClasses: < public final #22; //class A_1$$anonfun$f$1 37,45c35,40 < #21 = Utf8 A_1$$anonfun$f$1 < #22 = Class #21 // A_1$$anonfun$f$1 < #23 = Utf8 Code --- > #21 = Utf8 Code
| | * | Merge pull request #3072 from retronym/backport/7519Adriaan Moors2013-10-245-0/+51
| | |\ \ | | | | | | | | | | [nomaster] SI-7519 Less brutal attribute resetting in adapt fallback
| | | * | SI-7519: Additional test case covering sbt/sbt#914Mark Harrah2013-10-233-0/+26
| | | | | | | | | | | | | | | | | | | | (cherry picked from commit e72c32db03b44d6eaf1c1872765a578c5445e15f)
| | | * | [nomaster] SI-7519 Less brutal attribute resetting in adapt fallbackJason Zaugg2013-10-232-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses track of which enclosing class of the given name is referenced by a `This` node which prefixes the an applied implicit view. The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804 Cherry picked from 433880e91cba9e1e926e9fcbf04ecd4aeb1d73eb Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * | | [nomaster] SI-6026 backport getResource bug fixSom Snytt2013-10-182-0/+18
| | |/ / | | | | | | | | | | | | | | | | Submitted to master under SI-4936, this fix allows :javap to work when tools.jar is discovered by REPL.
* | | | Merge pull request #3129 from adriaanm/pr-rebase-3001Adriaan Moors2013-11-13240-469/+756
|\ \ \ \ | |/ / / |/| | | [rebase] blackbox and whitebox macros
| * | | blackbox restriction #4: can't customize pattern matchingEugene Burmako2013-11-127-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro is used as an extractor in a pattern match, it triggers an unconditional compiler error, preventing customizations of pattern matching implemented with macros.
| * | | blackbox restriction #3: can't affect implicit searchEugene Burmako2013-11-1210-11/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro is used as an implicit candidate, no expansion is performed until the macro is selected as the result of the implicit search. This makes it impossible to dynamically calculate availability of implicit macros.
| * | | blackbox restriction #2: can't guide type inferenceEugene Burmako2013-11-1211-1/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro still has undetermined type parameters after Scala’s type inference algorithm has finished working, these type parameters are inferred forcedly, in exactly the same manner as type inference happens for normal methods. This makes it impossible for blackbox macros to influence type inference, prohibiting fundep materialization.
| * | | blackbox restriction #1: can't refine the official return typeEugene Burmako2013-11-1218-21/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application of a blackbox macro expands into a tree `x`, the expansion is wrapped into a type ascription `(x: T)`, where `T` is the declared return type of the blackbox macro with type arguments and path dependencies applied in consistency with the particular macro application being expanded. This invalidates blackbox macros as an implementation vehicle of type providers.
| * | | blackbox and whitebox macrosEugene Burmako2013-11-12210-466/+492
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first commit in the series. This commit only: 1) Splits Context into BlackboxContext and WhiteboxContext 2) Splits Macro into BlackboxMacro and WhiteboxMacro 3) Introduces the isBundle property in the macro impl binding Here we just teach the compiler that macros can now be blackbox and whitebox, without actually imposing any restrictions on blackbox macros. These restrictions will come in subsequent commits. For description and documentation of the blackbox/whitebox separation see the official macro guide at the scaladoc website: http://docs.scala-lang.org/overviews/macros/blackbox-whitebox.html Some infrastructure work to make evolving macros easier: compile partest-extras with quick so they can use latest library/reflect/...
* | | Merge pull request #3090 from densh/pull/undo-forAdriaan Moors2013-11-1315-102/+195
|\ \ \ | | | | | | | | Add support for For loops to quasiquotes
| * | | test legacy .filter support in for loop resugaringDen Shabalin2013-11-121-0/+11
| | | |
| * | | add support for for loops and for enumerators to quasiquotesDen Shabalin2013-11-122-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | 1. q"for (..$enums) $body", q"for (..$enums) yield $body" 2. fq"..." quote to construct/deconstruct enumerators