summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2930 from retronym/topic/patmat-inference-prepJason Zaugg2013-09-1145-160/+13
|\ | | | | Topic/patmat inference prep
| * Limit bad advice given for erroneous pattern.Paul Phillips2013-08-293-0/+13
| | | | | | | | | | Don't suggest "_: <none>" as an alternative when the pattern type doesn't conform to the expected type.
| * Removing orphan check/flag files.Paul Phillips2013-08-2942-160/+0
| |
* | Merge pull request #2910 from densh/topic/quasiquote-improvement-finalJason Zaugg2013-09-119-256/+530
|\ \ | | | | | | Various bugfixes and improvements for the quasiquotes
| * | 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
| | |
* | | Merge pull request #2904 from som-snytt/issue/reflect-priv-ctorJason Zaugg2013-09-102-0/+23
|\ \ \ | | | | | | | | SI-7810 Reflect private constructor
| * | | SI-7810 Reflect private constructorSom Snytt2013-09-032-0/+23
| | | | | | | | | | | | | | | | | | | | `JavaMirror.constructorToJava` uses `getDeclaredConstructor` now instead of `getConstructor`.
* | | | Merge pull request #2926 from paulp/pr/treecheckersJason Zaugg2013-09-107-0/+38
|\ \ \ \ | | | | | | | | | | Noise reduction + minor enhance in TreeCheckers.
| * | | | Noise reduction + minor enhance in TreeCheckers.Paul Phillips2013-09-097-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Misc irrelevant work, which I can only offer as-is. It lowers the noise in -Ycheck:* output and performs some common sense chillaxes like not screaming ERROR IN INTERNAL CHECKING! WE'RE ALL GOING TO DIE! when a tree doesn't hit all nine points at the Jiffy Tree. You can see some reasonably well reduced symbol flailing if you run the included pending tests: test/partest --show-diff test/pending/pos/treecheckers Example output, Out of scope symbol reference { tree TypeTree Factory[Traversable] position OffsetPosition test/pending/pos/treecheckers/c5.scala:3 with sym ClassSymbol Factory: Factory[CC] and tpe ClassArgsTypeRef Factory[Traversable] encl(1) ModuleSymbol object Test5 ref to AbstractTypeSymbol X (<deferred> <param>) }
* | | | | Merge pull request #2915 from retronym/ticket/7817Jason Zaugg2013-09-104-0/+201
|\ \ \ \ \ | |/ / / / |/| | | | SI-7817 Fix regression in structural types
| * | | | SI-7817 Fix regression in structural typesJason Zaugg2013-09-092-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to structural types are converted to reflective calls in the `cleanup` phase, which, along with `mixin`, does its work after `flatten`. `Symbol#owner` behaves in a phase dependent manner; after flatten the owner of lifted class is given as the enclosing package. Except when they're not. `ModuleSymbol`s representing an object nested inside a class are viewed dually as modules *and* methods (see the comments on `isModuleNotMethod` for some background). When it comes time to flatten, we're presented with a quandary: the method must clearly stay owned by the enclosing class, but surely the lifted module should be owned by the enclosing package, to have the same owner as its associated module class. The `method` nature of this symbol seems to win: override def owner = { if (Statistics.hotEnabled) Statistics.incCounter(ownerCount) if (!isMethod && needsFlatClasses) rawowner.owner else rawowner This wrinkle leads to a wrong turn in `TreeGen#mkAttributedRef`, which incorrectly rewrites `REF(O)` to `p1.`package`.O`. It seems this problem has gone unnoticed because the tree emitted referred to a static symbol (the reflection cache for structural types), and the backend simply elided the qualifier `p1.package`. A recent change to the backend makes it more conservative about dropping qualifiers on the floor, and it started emitting a reference to a package object that doesn't exist. This commit despairingly checks `isDefinedInPackage` of both the module *and* the module class. The test cases from the previous commit illustrated the status quo, and this commit updates the joint compilation test with the bug fix. A new test is to show that the symptom (structural type crash) is now fixed.
| * | | | SI-7817 Tests to show the foibles of mkAttributedRefJason Zaugg2013-09-094-0/+201
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To `package`, or not `package`, that is the question. This lines marked with !!! get this wrong, and be remedied by the next commit. This problem is culpable for the crash in the enclosed `pending` test.
* | | | Merge pull request #2907 from paulp/pr/typetree-original-rangeposJason Zaugg2013-09-094-11/+28
|\ \ \ \ | | | | | | | | | | Eliminate TypeTrees with null original.
| * | | | Eliminate TypeTrees with null original.Paul Phillips2013-09-044-11/+28
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a retry of #2801 after figuring out the range position error. Should there be anyone out there who compiles with -Xdev, know that this commit eliminates the 1406 errors one presently incurs compiling src/library. A val declared in source code receives only one tree from the parser, but two are needed - one for the field and one for the getter. I discovered long ago that if the val had an existential type, this was creating issues with incompatible existentials between the field and the getter. However the remedy for that did not take into account the whole of the wide range of super subtle issues which accompany tree duplication. In particular, the duplicated tree must be given not only a fresh TypeTree(), but that TypeTree cannot share the same original without running afoul of range position invariants. That's because typedTypeTree resurrects the original tree with whatever position it has - so the "original" needs to be a duplicate of the original with a focused position. Should the call to TypeTree.duplicate also duplicate the original? I think so, but I bequeath this question to others. This commit also eliminated some duplicate error messages, because duplicate suppression depends on the errors having the same position. See c478eb770d, 7a6fa80937 for previous related work.
* | | | Merge pull request #2885 from som-snytt/issue/7791-script-linenumsJason Zaugg2013-09-083-0/+25
|\ \ \ \ | | | | | | | | | | SI-7791 Line number table reflects underlying file
| * | | | SI-7791 Line number table reflects underlying fileSom Snytt2013-09-053-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since positions ultimately know their ultimate positions in their ultimate source, use that line number, ultimately, when emitting line number table entries. It is possible, but possibly not useful, to emit both the actual (ultimate) line number and the nominal one. The `int`-valued line number of the `StackTraceElement` is "derived" from the attribute. In global, wrapping a `BatchSourceFile` as a `ScriptSource` happens in `compileSources` to facilitate testing. A `ScriptTest` facility is provided to facilitate testing the script facility. It is rather facile.
* | | | | Merge pull request #2865 from folone/trampolinesGrzegorz Kossakowski2013-09-071-0/+13
|\ \ \ \ \ | | | | | | | | | | | | Alter TailRec to have map and flatMap
| * | | | | Alter TailRec to have map and flatMapGeorge Leontiev2013-08-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in the "Stackless Scala with Free Monads" paper scala> import scala.util.control.TailCalls._ import scala.util.control.TailCalls._ scala> :paste // Entering paste mode (ctrl-D to finish) def isEven(xs: List[Int]): TailRec[Boolean] = if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail)) def isOdd(xs: List[Int]): TailRec[Boolean] = if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail)) // Exiting paste mode, now interpreting. isEven: (xs: List[Int])util.control.TailCalls.TailRec[Boolean] isOdd: (xs: List[Int])util.control.TailCalls.TailRec[Boolean] scala> isEven((1 to 100000).toList).result res0: Boolean = true scala> def fib(n: Int): TailRec[Int] = | if (n < 2) done(n) else for { | x <- tailcall(fib(n - 1)) | y <- tailcall(fib(n - 2)) | } yield (x + y) fib: (n: Int)util.control.TailCalls.TailRec[Int] scala> fib(40).result res1: Int = 102334155
* | | | | | Merge pull request #2917 from som-snytt/issue/7805-repl-iGrzegorz Kossakowski2013-09-074-5/+60
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7805 REPL -i startup
| * | | | | | SI-7805 REPL -i startupSom Snytt2013-09-064-5/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested with a ReplTest that loads an include script. ReplTests can choose to be `Welcoming` and keep a normalized welcome message in their check transcript. One recent SessionTest is updated to use the normalizing API.
* | | | | | | Merge pull request #2912 from retronym/ticket/7643Grzegorz Kossakowski2013-09-074-0/+18
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7643 Enable newPatternMatching in interactive.
| * | | | | | | SI-7643 Enable newPatternMatching in interactive.Jason Zaugg2013-09-064-0/+18
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without it, the enclosed test fails with: ArrayBuffer(Problem(RangePosition(partial-fun/src/PartialFun.scala, 62, 62, 77),type mismatch; found : Int => Int required: PartialFunction[Int,Int],2)) And with that, we can remove this option altogether.
* | | | | | | Merge pull request #2855 from adriaanm/modularize-xml-parsersv2.11.0-M5Grzegorz Kossakowski2013-09-06131-3221/+19
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Modularize: xml & parser-combinators
| * | | | | | Prepare removal of scala-xml, scala-parser-combinatorsAdriaan Moors2013-08-27131-3221/+19
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every test deleted here has found its way to the respective repositories of scala-xml and scala-parser-combinators, where they will continue to be tested with partest. The modified tests became independent of these modules, as they should've been from the start.
* | | | | | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-09-059-0/+363
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/reflect/scala/reflect/internal/SymbolTable.scala src/reflect/scala/reflect/internal/util/WeakHashSet.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala
| * | | | | Merge pull request #2888 from xeno-by/topic/typed-annotatedJason Zaugg2013-09-043-0/+21
| |\ \ \ \ \ | | | | | | | | | | | | | | typedAnnotated no longer emits nulls
| | * | | | | typedAnnotated no longer emits nullsEugene Burmako2013-08-293-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a null-check in original synthesis for the result of typedAnnotated. Previously it was possible for the aforementioned result to look like TypeTree(<tpe>) setOriginal Annotated(..., null). Not anymore.
| * | | | | | Merge pull request #2901 from gkossakowski/backport-uniques-memory-fixGrzegorz Kossakowski2013-09-041-0/+174
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Backport #2605 to 2.10.x: SI-7149 Use a WeakHashSet for type uniqueness
| | * | | | | | SI-7150 Replace scala.reflect.internal.WeakHashSetGrzegorz Kossakowski2013-09-031-0/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces scala.reflect.internal.WeakHashSet with a version that * extends the mutable.Set trait * doesn't leak WeakReferences * is unit tested
| * | | | | | | Merge pull request #2876 from retronym/ticket/7782Jason Zaugg2013-09-042-0/+50
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7782 Derive type skolems at the ground level
| | * | | | | | | SI-7782 Derive type skolems at the ground levelJason Zaugg2013-08-272-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than at the current value of `skolemizationLevel`, which could be influenced by an in-flight existential subtype computation. This method is called in `PolyTypeCompleter`, which could be constructed by the lazy type completer of the enclosing class. So currently it is closing over a mutable variable; hence the Heisenbug. This issue was exposed by the changes in b74c33eb860, which was introduced in Scala 2.10.1.
| * | | | | | | | Merge pull request #2899 from som-snytt/issue/4760-parserJason Zaugg2013-09-041-0/+34
| |\ \ \ \ \ \ \ \ | | |_|/ / / / / / | |/| | | | | | | SI-4760 Parser handles block-ending import
| | * | | | | | | SI-4760 Parser handles block-ending importSom Snytt2013-08-301-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't molest the RBRACE. Updated with additional parse tests suggested by @retronym. "What are you lazy?" Yes, I must be lazy. Can't ScalaCheck or Par-Test generate these tests automatically? That seems like a reasonable expectation.
| * | | | | | | | Commit .gitignore directlyJason Zaugg2013-08-301-0/+0
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than relying on the cloner to copy the provided gitignore.SAMPLE files. This finishes the job started in c48509598, mostly by reverting that commit and moving the two existing SAMPLE files to the final destinations. Use `.git/info/exclude` to augment the list of patterns with entries specific to your workflow. (cherry picked from commit b51cb581270da7021b2ea122dc059847101d56a7) ============================================== Paring back the scope of our shared .gitignore Importantly, limit the exclusion of build.properties to the file in the root directory, paving the way for the return of an SBT build. - Unignores .bak, .jar, and ~ - limit ignorance of qbin to the root directory .log files, generated by partest, are still ignored. To see ignored files in your workspace, try: git ls-files --others --ignored --exclude-standard -- test | grep log git status --ignored -- test (cherry picked from commit f0bbd2ca32acb40be37dc382c1f95081deca3f22)
| * | | | | | | Merge pull request #2868 from retronym/ticket/7775Jason Zaugg2013-08-291-0/+17
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7775 Harden against the shifting sands of System.getProperties
| | * | | | | | | SI-7775 Harden against the shifting sands of System.getPropertiesJason Zaugg2013-08-261-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If another thread writes a new system property (which can happen in pretty innocuous code such as `new Date`!), the compiler startup could fail with a `ConcurrentModificationException` as it iterated all bindings in the properties map in search of a boot classpath property for esoteric JVMs. This commit uses `Properties#getStringProperties` to get a snapshot of the keys that isn't backed by the live map, and iterates these instead. That method will also limit us to bindings with String values, which is all that we expect.
| * | | | | | | | Merge pull request #2871 from retronym/ticket/7779Jason Zaugg2013-08-291-0/+67
| |\ \ \ \ \ \ \ \ | | |_|_|/ / / / / | |/| | | | | | | SI-7779 Account for class name compactification in reflection
| | * | | | | | | SI-7779 Account for class name compactification in reflectionJason Zaugg2013-08-231-0/+67
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to assume that the classes we are reflecting on were compiled with the default value for -Xmax-classfile-name (255). With this assumption, we can apply the same name compactification as done in the regular compiler. The REPL is particularly prone to generating long class names with the '$iw' prefixes, so this is an important fix for runtime reflection. Also adds support for getting the runtime class of `O.type` if `O` is a module.
* | | | | | | | SI-7781 Improve test and add commentSom Snytt2013-09-021-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test should normalize the elided message, not strip it. (Thanks qerub; I was frustrated with kitteh's turnaround that night, hence unwilling to improve once it passed.)