summaryrefslogtreecommitdiff
path: root/test/files/scalacheck
Commit message (Collapse)AuthorAgeFilesLines
* SI-7979 Fix quasiquotes crash on mismatch between fields and constructorDen Shabalin2013-12-101-0/+16
|
* SI-6842 Make splicing less sensitive to precise types of treesDen Shabalin2013-12-103-14/+26
| | | | | | | | | Previously trees that represent parameters, case clauses and type variables had strictly defined ValDef, TypeDef and CaseDef types which caused problems in compositionality. Now this checks are moved to runtime so it's possible to pass a tree that is CaseDef but has Tree type.
* SI-8009 Ensure that Idents preserve isBackquoted propertyDen Shabalin2013-12-101-0/+4
|
* SI-8016 Ensure that q”..$xs” is equivalent to q”{..$xs}”Den Shabalin2013-12-101-0/+6
|
* SI-8008 Make q”f(..$xs)” only match trees with Apply nodeDen Shabalin2013-12-101-2/+4
| | | | | | | | | | Previously it also matched other nodes but returned Nil as value of xs. This behavior was added for sake of consistentcy with q”f[..$ts]”. On the other hand q”f[..$Nil]” == q”f” but q”f(..$Nil)” == q”f()” not q”f”. Due to this deconstruction/construction symmetry was broken. On the other hand applications also have q"f(...$xss)" option which is infact similar to q"f[..$ts]". Splicing Nil into it also results in q"f".
* Merge pull request #3138 from densh/pr/fresh-name-extractorJason Zaugg2013-11-221-7/+6
|\ | | | | Refactor out fresh name prefix extraction logic
| * refactor out fresh name prefix extraction logicDen Shabalin2013-11-171-7/+6
| | | | | | | | | | | | | | | | | | | | | | 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-221-1/+1
|\ \ | | | | | | Removing deprecated code.
| * | Removing deprecated code.Paul Phillips2013-11-181-1/+1
| |/ | | | | | | | | Code which has been deprecated since 2.10.0 and which allowed for straightforward removal.
* / 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.
* 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
* implement inverse transformation to mkForDen Shabalin2013-11-122-0/+39
| | | | | | | | | | | This effectively reconstructs a sequence of enumerators and body from the tree produced by mkFor. This lets to define bi-directional SyntacticFor and SyntacticForYield constructors/extractors to work with for loops. Correctness of the transformation is tested by a scalacheck test that generates a sequence of random enumerators, sugars them into maps/flatMaps/foreach/withFilter calls and reconstructs them back.
* make fresh names compare similar in quasiquotesDen Shabalin2013-11-122-4/+26
| | | | | | Otherwise it's annoying that trees that look the same are not equal due to some fresh name hidden underneath. Due to this one test needs to be changed to use plain equalsStructure.
* simplify imports in quasiquotes scalacheck testsDen Shabalin2013-11-1212-91/+25
|
* add some post-typecheck tests for quasiquotesDen Shabalin2013-11-123-2/+45
| | | | | | Typecheck trees with toolbox and check that they are still matched by corresponding quasiquote. Fix tuples and function types matchers to account for different shape of trees after typing.
* deduplicate tuple tree creation codeDen Shabalin2013-11-122-5/+5
| | | | | | Previously tuple tree generation code has been implemented in three place: tree builder, tree gen, build utils. Now it's just defined once in tree gen.
* SI-7938 - parallel collections should use default ExecutionContextAleksandar Prokopec2013-10-299-64/+114
| | | | | | | | | | Parallel collections now use `scala.concurrent.ExecutionContext` by default. The `ExecutionContextTaskSupport` is optimized to use the `ForkJoinPool` underlying the `ExecutionContext` if possible. Otherwise, a fallback `TaskSupport` that creates a reduction tree and execute an operation through `Future`s is used.
* SI-6840 fixes weird typing of quasiquote argumentsDen Shabalin2013-10-191-0/+9
| | | | | | | | | | | | | Previously quasiquote arguments were type checked against Any which caused weird inference that made splicing of complex expressions unusable: val l1 = List(q"foo") val l2 = List(q"bar") q"f(..${l1 ++ l2})" // argument type checked as Any instead of List[Tree] This is fixed by forcing compiler to type check against type variable which itself isn't used in any other way.
* make q"f(..$xs)" deconstruction symmetrical to q"f[..$xs]"Den Shabalin2013-10-181-3/+2
|
* advanced fresh name reificationDen Shabalin2013-10-182-2/+32
| | | | | | | | | | During parsing some names are generated artificially using freshTermName & freshTypeName (e.g. `x$1`). Such names should be reified in a different way because they are assumed to be always fresh and non-overlapping with the environment. So `x$1` should reify down to equivalent of `freshTermName("x$")` rather than `TermName("x$1")`. But this is not enough. One name can be used more than once in a tree. E.g. `q"_ + 1"` desugars into `q"x$1 => x$1 + 1"`. So we need to ensure that every place where `x$1` is used gets the same fresh name. Hence the need for `withFreshTermName` that lets q"_ + 1" quasiquote desugare into equivalent of `withFreshTermName("x$") { freshx => q"$freshx => $freshx + 1" }`. For pattern quasiquotes it's a bit different. Due to the fact that end-result must be a pattern we need to represent fresh names as patterns too. A natural way to express that something is fresh is to represent it as a free variable (e.g. any name will do in that place). But due to possible use of the same name in multiple places we need to make sure that all such places have the same values by adding a sequence of guards to the pattern. Previously such names were reified naively and it could have caused name collision problems and inability to properly much on trees that contain such names.
* use regular macro expansion logic for unapply quasiquotesDen Shabalin2013-10-141-4/+1
| | | | | | | Previously due to limited support for expansion in apply position quasiquotes had to use a compiler hook for deconstruction. Now with recent changes in pattern matcher it's possible to remove that special case.
* minor changes due to typosDen Shabalin2013-10-141-1/+1
|
* SI-6841 SI-6657 add support for packages into quasiquotes and toolboxDen Shabalin2013-10-142-0/+74
| | | | | | In order to implement this a new parser entry point `parseStatsOrPackages` that augments current parseStats with ability to parse "package name { ... }" syntax.
* harden test case to avoid parsing failure when name is keywordDen Shabalin2013-10-141-1/+3
|
* Merge pull request #2962 from densh/topic/syntactic-assignJason Zaugg2013-09-232-0/+44
|\ | | | | Quasiquotes: add syntactic extractor for assignment-like trees
| * add syntactic extractor for assignment-like treesDen Shabalin2013-09-182-0/+44
| | | | | | | | | | | | | | | | | | | | | | There are three kinds of assign-like trees: 1. Assign(lhs, rhs) // $lhs = $rhs 3. AssignOrNamedArg(lhs, rhs) // $lhs = $rhs 2. Apply(Select(f, nme.update), args :+ rhs) // $f(..$args) = $rhs New syntactic combinator unifies all of them and lets users not to think about these implementations details.
* | Cull extraneous whitespace.Paul Phillips2013-09-1827-254/+254
|/ | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* SI-7304 improve deprecation warnings for tree factory methodsDen Shabalin2013-09-112-1/+54
|
* streamline implementation of annotation splicingDen Shabalin2013-09-051-0/+10
| | | | | | Syntax spec mislead me to believe that annotation can't have type parameters or multiple argument lists... I guess the lesson here is don't trust the spec.
* unify handling of references to scala members for functions and tuplesDen Shabalin2013-09-051-1/+1
|
* better support for ValDefs, VarDefs and DefDefsDen Shabalin2013-09-051-0/+9
|
* SI-7723 better support for deconstruction of new expressionsDen Shabalin2013-09-051-0/+17
|
* SI-7803 support for matching of anonymous function literalsDen Shabalin2013-09-052-1/+18
|
* first-class early def splicing and extraction supportDen Shabalin2013-09-052-2/+107
|
* add support for function type splicing and extractionDen Shabalin2013-09-052-0/+12
|
* reify ScalaPackage symbol with the help of ScalaDotDen Shabalin2013-09-051-1/+2
|
* refine block and applied/typeapplied splicing/matching semanticsDen Shabalin2013-09-054-5/+12
| | | | | | | | | | | | | | | | | | | 1. blocks now match single term-level expressions to account for automatic block elimination. E.g. val q"{ ..$stats }" = q"foo" will match into stats = List(q"foo"). This is useful to uniformly deal with blocks on term level. 2. blocks in quasiquotes collapse into single expressions 3. Applied and TypeApplied now have constructors too which helps to unify matching and extraction in quasiquote reifier 4. TypeApplied now matches AppliedTypeTree too 5. Add Syntactic prefix to Applied and TypeApplied
* SI-7196 add support for refineStat splicing and extractionDen Shabalin2013-09-052-0/+10
|
* refactor definition tests into separate subsuiteDen Shabalin2013-09-055-249/+326
|
* add toolbox-based utility methods to quasiquotes' testsDen Shabalin2013-09-051-6/+15
|
* SI-6843 well-positioned syntax errors for quasiquotesDen Shabalin2013-08-141-6/+0
| | | | | | | | | | | | | This is achieved in a following way: 1. Similarly to toolbox quasiquotes can go away with wrapping for parsing purpose after introduction of `parseStats` and `parseRule` entry points. 2. In case of syntax error quasiquote computes equivalent corresponding position in the source code with the help of `corrrespondingPosition` mapper which relies on position data collected into `posMap` during code generation.
* Merge pull request #2764 from folone/masterGrzegorz Kossakowski2013-08-121-0/+59
|\ | | | | Making map2Conserve occupy constant stack space in spirit of SI-2411.
| * Make map2Conserve occupy constant stack space in spirit of SI-2411George Leontiev2013-08-081-0/+59
| | | | | | | | | | | | | | | | | | | | | | I recently discovered a StackOverflowError, caused by this function: https://gist.github.com/folone/7b2f2e2a16314ab28109 The circumstances are pretty extreme, still having a tail-recursive function seems to be a good idea. The function behaves the same way old function did (supported by tests), which is not really how map2 behaves. I did not change this behavior to not introduce any regression. I actually tried to make it behave like map2, and it does introduce regression.
* | DefDef.name is now TermName againEugene Burmako2013-08-101-1/+1
|/ | | | | Now when there's no hope left for type macros, it's reasonable to provide a more specific type for DefDef.name.
* tests for quasiquotesDen Shabalin2013-07-0811-0/+1280
| | | | | | Introduces an extensive ScalaCheck-based test suite for recently implemented quasiquotes. Provides tools for syntactic tree comparison and verifying compilation error messages.
* 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-7469 Remove @deprecated scala.util.loggingSimon Ochsenreither2013-05-161-3/+1
|
* SI-7349 Partest supports test-interfaceSom Snytt2013-04-302-54/+7
| | | | | | | | Partest uses test-interface API to invoke ScalaCheck. This obviates ad hoc output checking for result status. The context class loader is set to a loader that the scaladoc scalacheck tests can use.
* Maintenance of Predef.Paul Phillips2013-02-121-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Deprecates much of Predef and scala.Console, especially: - the read* methods (see below) - the set{Out,Err,In} methods (see SI-4793) 2) Removed long-deprecated: - Predef#exit - Predef#error should have gone, but could not due to sbt At least the whole source base has now been future-proofed against the eventual removal of Predef#error. The low justification for the read* methods should be readily apparent: they are little used and have no call to be in global namespace, especially given their weird ad hoc semantics and unreasonably tempting names such as readBoolean(). 3) Segregated the deprecated elements in Predef from the part which still thrives. 4) Converted all the standard Predef implicits into implicit classes, value classes where possible: - ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value) - SeqCharSequence, ArrayCharSequence (non-value) Non-implicit deprecated stubs prop up the names of the formerly converting methods.