summaryrefslogtreecommitdiff
path: root/test/files/pos
Commit message (Collapse)AuthorAgeFilesLines
* SI-9665 Backquoted vbar in extractor patternSom Snytt2016-03-151-0/+7
| | | | Allow an infix extractor named `|`, when backquoted.
* Merge pull request #4868 from retronym/ticket/9542-comboJason Zaugg2016-02-101-0/+8
|\ | | | | SI-9542 Fix regression in value classes (served two ways)
| * SI-9542 Unify different reprs. of module type refsJason Zaugg2016-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new unit test shows failures in transitivity of subtyping and type equivalence, which boil down the the inconsistent handling of the semantically equivalent: ThisType(pre, ModuleClass) ModuleTypeRef(pre, ModuleClass) SingleType(pre, Module) This commit: - adds a case to `normalizePlus` to unwrap a `ThisType` to a `ModuleTypeRef` - Use `normalizePlus` more widely during subtype comparison - refactor `fourthTry` (part of `isSubType`) to remove code that becomes obviated by the use of `normalizePlus`. This fixes the regression in the extension methods phase which was triggered by https://github.com/scala/scala/pull/4749. We can also fix that regression by tweaking the extension methods phase itself to emit the `ThisType` representation of the owner of the value class, as before. I plan to demonstrate the two approaches to fixing the regression on separate branches, and the propose that the merged result of these two is useds.
* | Merge pull request #4920 from lrytz/oldOptimizerTestsLukas Rytz2016-02-0325-664/+2
|\ \ | |/ |/| restore / rewrite various tests
| * Re-write and Re-enable optimizer testsLukas Rytz2016-02-0325-664/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite tests for new optimizer - SI-6941 - SI-2171 - t3430 - t3252 - t4840 - t2171 - t3430 - t3252 - t6157 - t6547 - t8062 - t8306 - t8359 - t9123 - trait-force-info - private-inline test cases for bugs fixed in the new optimizer - SI-9160, the unnecessary boxing mentioned in the ticket is optimzied since push-pop elimination (#4858). - SI-8796 - SI-8524 - SI-7807 fix flags file for t3420 remove an empty flags file remove unnecessary partest filters explicit inliner warnings in test t7582 Restore the lisp test. Removing the flags file - our build runs with the (new) optimizer enabled anyway. The test spent the past few years as an optimizer test in pos/ see https://issues.scala-lang.org/browse/SI-4512. The attempt may fail, but why not give it a try. $ git lg -S"lisp" ... | * | | | f785785 - SI-4579 Yoke the power of lisp.scala as a stress for the optimizer. (3 years, 8 months ago) <Jason Zaugg> ... * | | | | | | 622cc99 - Revert the lisp test. (3 years, 10 months ago) <Paul Phillips> ... * | | | | | | 97f0324 - Revived the lisp test. (3 years, 10 months ago) <Paul Phillips> ... * | 1e0f7dc - Imprison the lisp test, no review. (4 years, 4 months ago) <Paul Phillips> ... * | 6b09630 - "Freed the lisp test." Tweaked partest defaults... (4 years, 6 months ago) <Paul Phillips> ... * | fec42c1 - Lisp test wins again, no review. (4 years, 8 months ago) <Paul Phillips> ... * | 1c2d44d - Restored the lisp.scala test. (4 years, 8 months ago) <Paul Phillips> ... * | 15ed892 - Temporarily sending lisp.scala to be interprete... (4 years, 8 months ago) <Paul Phillips> ...
* | SI-9398 Treat case classes as one-element ADTs for analysisJason Zaugg2016-01-291-0/+1
| | | | | | | | | | | | | | | | Currently, exhaustivity analysis only runs for scrutinees with a sealed type. This commit treats any case class as a one-element, sealed type to enable additional analysis, such as in the new test case.
* | SI-9630 Fix spurious warning related to same-named case accessorsJason Zaugg2016-01-299-0/+101
|/ | | | | | | | | | | | | Hash consing of trees within pattern match analysis was broken, and considered `x1.foo#1` to be the same tree as `x1.foo#2`, even though the two `foo`-s referred to different symbols. The hash consing was based on `Tree#correspondsStructure`, but the predicate in that function cannot veto correspondance, it can only supplement the default structural comparison. I've instead created a custom tree comparison method for use in the pattern matcher that handles the tree shapes that we use.
* SI-9622 Native method may be privateSom Snytt2016-01-131-0/+4
| | | | | | This was lost in a refactor. https://github.com/scala/scala/commit/290f687fb6ab91b6aef62d871036ddc3829f12b4
* Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24Lukas Rytz2015-11-243-0/+15
|\
| * Attacking exponential complexity in TypeMapsJason Zaugg2015-11-133-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't normalize existentials during the `contain`-s type map; `ExistentialType#normalize' calls contains internally and an exponential blowup ensues. - Ensure that the type map used in variance validation never returns modified types in order to avoid needless cloning of symbols. The enclosed test case still gets stuck in Uncurry, thanks to the way that `TypeMap#mapOver(List[Symbol])` recurses through the type first to check whether the type map would be an no-op or not. If not, it repeats the type map with cloned symbols. Doing the work twice at each level of recursion blows up the complexity. Removing that "fast path" allows the enclosed test to compile completely. As at this commit, it gets stuck in uncurry, which dealiases `s.List` to `s.c.i.List` within the type. Some more background on the troublesome part of `TypeMap`: http://lrytz.github.io/scala-aladdin-bugtracker/displayItem.do%3Fid=1210.html https://github.com/scala/scala/commit/f8b2b21050e7a2ca0f537ef70e3e0c8eead43abc
| * Merge pull request #4757 from lrytz/t9375-2.11Lukas Rytz2015-09-221-0/+18
| |\ | | | | | | [backport] SI-9375 add synthetic readResolve only for static modules
| | * [backport] SI-9375 add synthetic readResolve only for static modulesLukas Rytz2015-09-221-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | For inner modules, the synthetic readResolve method would cause the module constructor to be invoked on de-serialization in certain situations. See the discussion in the ticket. Adds a comprehensive test around serializing and de-serializing modules.
* | | Merge pull request #4822 from retronym/ticket/9178Lukas Rytz2015-11-184-0/+22
|\ \ \ | | | | | | | | SI-9178 Don't eta expand to an Function0-like SAM expected type
| * | | SI-9178 Test for the status quo of eta-expansion to Func0Jason Zaugg2015-11-172-0/+14
| | | |
| * | | SI-9178 Don't eta expand param-less method types to SAMsJason Zaugg2015-10-272-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise, we can end up with a subtle source incompatibility with the pre-SAM regime. Arguably we should phase out eta expansion to Function0 as well, but I'll leave that for another day.
* | | | Remove GenASM, merge remaining common code snippetsSimon Ochsenreither2015-10-279-76/+21
|/ / / | | | | | | | | | | | | | | | | | | | | | With GenBCode being the default and only supported backend for Java 8, we can get rid of GenASM. This commit also fixes/migrates/moves to pending/deletes tests which depended on GenASM before.
* | | SI-9498 Avoid caching bug with pattern type variablesJason Zaugg2015-09-301-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typechecking a pattern that defines a pattern type variable initially assigns abstract type symbol with open type bounds. Later on, pattern type inference kicks in to sharpen the type of the variable based on constraints imposed by the expected type (ie, the type of scrutinee of the pattern.) However, before inference does this, a `TypeRef` to the abstract type symbol can be queried for its base type with respect to some class, which leads to it populating an internal cache. This cache becomes stale when the underlying symbol has its type mutated. The repercussions of this meant that a subsequent call to `baseType` gave the wrong result (`NoType`), which lead to an `asSeenFrom` operation to miss out of substitution of a type variable. Note the appearance of `A` in the old type errors in the enclosed test case. This commit takes an approach similar to 286dafbd to invalidate caches after the mutation. I've routed both bandaids through the same first aid kit: I'm sure over time we'll add additional calls to this method, and additional cache invalidations within it.
* | | Merge commit 'a170c99' into 2.12.xLukas Rytz2015-09-2232-1/+45
|\| |
| * | fix t9370 so it works on Windows tooSeth Tisue2015-09-181-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partest has custom code for -Xplugin handling (see DirectCompiler.updatePluginPath for details). that code has its own idea of what the syntax of -Xplugin is, different from Scalac's. partest's idea is that multiple paths should be separated by the platform classpath separator character, so : on Unix and ; on Windows. the .flags file here was using a colon, and that confuses partest on Windows, since partest was expecting a semicolon. it might be nice to fix partest to accept comma as the separator instead, which is standard for a scalac MultiStringSetting such as -Xplugin. but it turns out we have an out: we can just provide multiple -Xplugin flags. what evidence do I have that this is the right change? * the test still passes on both Windows and Mac OS X (manually tested); if Travis likes it, we'll know it passes on Linux too * I tried reverting Som's fix for SI-9370 (c32ba93) and the test failed, as expected, both with and without my change * I added a bunch of debugging output to DirectCompiler.updatePluginPath in partest, built a new partest jar, and used it to run the test on Windows with and without my fix, and verified by eye that the logic there was operating as expected in both cases and in conclusion, for Som's benefit: <insert cryptic joke here>
| * SI-9475 Dependent PolyTypes are dependent typesVlad Ureche2015-09-171-0/+19
| | | | | | | | Such that uncurry can correctly un-dependify them.
| * Merge pull request #4727 from SethTisue/unset-stray-execute-bitsSeth Tisue2015-09-1428-0/+0
| |\ | | | | | | unset inappropriate execute bits
| | * unset inappropriate execute bitsSeth Tisue2015-09-0228-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I imagine these date back to old Subversion days and are probably the result of inadvertent commits from Windows users with vcs client configs. having the bit set isn't really harmful most of the time, but it's just not right, and it makes the files stand out in directory listings for no reason
| * | SI-9369 Fix pattern matcher warnings for diamond shaped inheritance.Gerard Basler2015-09-122-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A previous optimization (d44a86f432a7f9ca250b014acdeab02ac9f2c304) for pattern matcher exhaustivity checks used a smarter encoding to ensure that the scrutinee can be equal to one child only. However, in case of traits between the root and leave type, a child can be of several types and these types should not be in a mutually exclusive group. A simple solution (hat tip to retronym) is to just put traits and classes into separate groups.
| * | Merge pull request #4704 from VladUreche/issue/9442Jason Zaugg2015-09-061-0/+14
| |\ \ | | |/ | |/| SI-9442 Fix the uncurry-erasure types
| | * SI-9442 Fix the uncurry-erasure typesVlad Ureche2015-08-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the "uncurry-erased" type (the one after the uncurry phase) can lead to incorrect tree transformations. For example, compiling: ``` def foo(c: Ctx)(l: c.Tree): Unit = { val l2: c.Tree = l } ``` Results in the following AST: ``` def foo(c: Ctx, l: Ctx#Tree): Unit = { val l$1: Ctx#Tree = l.asInstanceOf[Ctx#Tree] val l2: c.Tree = l$1 // no, not really, it's not. } ``` Of course, this is incorrect, since `l$1` has type `Ctx#Tree`, which is not a subtype of `c.Tree`. So what we need to do is to use the pre-uncurry type when creating `l$1`, which is `c.Tree` and is correct. Now, there are two additional problems: 1. when varargs and byname params are involved, the uncurry transformation desugares these special cases to actual typerefs, eg: ``` T* ~> Seq[T] (Scala-defined varargs) T* ~> Array[T] (Java-defined varargs) =>T ~> Function0[T] (by name params) ``` we use the DesugaredParameterType object (defined in scala.reflect.internal.transform.UnCurry) to redo this desugaring manually here 2. the type needs to be normalized, since `gen.mkCast` checks this (no HK here, just aliases have to be expanded before handing the type to `gen.mkAttributedCast`, which calls `gen.mkCast`)
| * | Fix typos in spec, docs and commentsMichał Pociecha2015-08-232-3/+3
| |/
| * SI-9393 fix modifiers of ClassBTypes for Java annotationsLukas Rytz2015-07-247-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Scala classfile and java source parsers make Java annotation classes (which are actually interfaces at the classfile level) look like Scala annotation classes: - the INTERFACE / ABSTRACT flags are not added - scala.annotation.Annotation is added as superclass - scala.annotation.ClassfileAnnotation is added as interface This makes type-checking @Annot uniform, whether it is defined in Java or Scala. This is a hack that leads to various bugs (SI-9393, SI-9400). Instead the type-checking should be special-cased for Java annotations. This commit fixes SI-9393 and a part of SI-9400, but it's still easy to generate invalid classfiles. Restores the assertions that were disabled in #4621. I'd like to leave these assertions in: they are valuable and helped uncovering the issue being fixed here. A new flag JAVA_ANNOTATION is introduced for Java annotation ClassSymbols, similar to the existing ENUM flag. When building ClassBTypes for Java annotations, the flags, superclass and interfaces are recovered to represent the situation in the classfile. Cleans up and documents the flags space in the area of "late" and "anti" flags. The test for SI-9393 is extended to test both the classfile and the java source parser.
| * [backport] SI-9392 Avoid crash in GenBCode for incoherent treesJason Zaugg2015-07-232-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A macro in shapeless was generating a tree of the form: ``` { class C#2 new C#2 }.setType(C#1) ``` This happened due to an error in the macro; it used untypecheck to try to fix the owner-chain consistency problem, but kept a reference to the previous version of the block-local class symbol `C` and used this in the resulting tree. This commit detects the particular situation we encountered, and avoids the crash by not creating the `NestedInfo` for the `BType` corresponding to `C#1`. The code comment discusses why I think this is safe, and suggests a refactoring that would mean we only ever try to construct `NestedInfo` when we are going to need them.
| * [backport] SI-9393 Temporarily disable two assertions in GenBCodeJason Zaugg2015-07-233-0/+21
| | | | | | | | | | | | These cause a crash in the build of Play. We should try to bring these back once we have suitable annotation awareness. Perhaps they should only be `devWarning`-s, though.
* | Merge pull request #4711 from lrytz/opt/heuristicsLukas Rytz2015-09-222-22/+0
|\ \ | | | | | | Inliner heuristic for higher-order methods
| * \ Merge remote-tracking branch 'upstream/2.12.x' into opt/heuristicsLukas Rytz2015-09-184-3/+35
| |\ \
| * | | Revert workaround for SI-8334Lukas Rytz2015-09-172-22/+0
| | | | | | | | | | | | | | | | The new optimizer doesn't have this problem.
* | | | SI-9479 Fix regression w. inherited overloads in package objectJason Zaugg2015-09-192-0/+30
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | One shouldn't base any decisions of the owner of an overloaded symbol. Instead, the owner of each of the alternatives should be considered. This gotcha is super easy to forget, as I did with my change to simplify the way we detect whether we need to add the `.package` prefix to a tree.
* | | Merge remote-tracking branch 'origin/2.11.x' into 2.12.xSeth Tisue2015-09-083-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | only trivial merge conflicts here. not dealing with PR #4333 in this merge because there is a substantial conflict there -- so that's why I stopped at 63daba33ae99471175e9d7b20792324615f5999b for now
* | | Merge pull request #4671 from lrytz/t9375-easyJason Zaugg2015-09-081-0/+18
|\ \ \ | |/ / |/| | SI-9375 add synthetic readResolve only for static modules
| * | SI-9375 add synthetic readResolve only for static modulesLukas Rytz2015-07-301-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | For inner modules, the synthetic readResolve method would cause the module constructor to be invoked on de-serialization in certain situations. See the discussion in the ticket. Adds a comprehensive test around serializing and de-serializing modules.
* | | Merge pull request #4638 from lrytz/t9393Jason Zaugg2015-07-247-8/+27
|\ \ \ | |/ / |/| | SI-9393 fix modifiers of ClassBTypes for Java annotations
| * | SI-9393 fix modifiers of ClassBTypes for Java annotationsLukas Rytz2015-07-227-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Scala classfile and java source parsers make Java annotation classes (which are actually interfaces at the classfile level) look like Scala annotation classes: - the INTERFACE / ABSTRACT flags are not added - scala.annotation.Annotation is added as superclass - scala.annotation.ClassfileAnnotation is added as interface This makes type-checking @Annot uniform, whether it is defined in Java or Scala. This is a hack that leads to various bugs (SI-9393, SI-9400). Instead the type-checking should be special-cased for Java annotations. This commit fixes SI-9393 and a part of SI-9400, but it's still easy to generate invalid classfiles. Restores the assertions that were disabled in #4621. I'd like to leave these assertions in: they are valuable and helped uncovering the issue being fixed here. A new flag JAVA_ANNOTATION is introduced for Java annotation ClassSymbols, similar to the existing ENUM flag. When building ClassBTypes for Java annotations, the flags, superclass and interfaces are recovered to represent the situation in the classfile. Cleans up and documents the flags space in the area of "late" and "anti" flags. The test for SI-9393 is extended to test both the classfile and the java source parser.
* | | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-07-236-2/+45
|\ \ \ | |/ / |/| / | |/ merge/2.11.x-to-2.12.x-20152307
| * Merge pull request #4631 from janekdb/2.11.x-typos-t-vSeth Tisue2015-07-202-2/+2
| |\ | | | | | | Fix 23 typos (t-v)
| | * Fix 23 typos (t-v)Janek Bogucki2015-07-152-2/+2
| | |
| * | Merge pull request #4595 from som-snytt/issue/9370Lukas Rytz2015-07-164-0/+43
| |\ \ | | |/ | |/| SI-9370 Xplugin scans plugin path for descriptor
| | * SI-9370 Xplugin scans plugin path for descriptorSom Snytt2015-06-304-0/+43
| | | | | | | | | | | | | | | Keep on scanning if the first entry doesn't yield a plugin.xml descriptor.
* | | Merge pull request #4623 from retronym/ticket/9392v2.12.0-M2Adriaan Moors2015-07-132-0/+20
|\ \ \ | | | | | | | | SI-9392 Avoid crash in GenBCode for incoherent trees
| * | | SI-9392 Avoid crash in GenBCode for incoherent treesJason Zaugg2015-07-132-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A macro in shapeless was generating a tree of the form: ``` { class C#2 new C#2 }.setType(C#1) ``` This happened due to an error in the macro; it used untypecheck to try to fix the owner-chain consistency problem, but kept a reference to the previous version of the block-local class symbol `C` and used this in the resulting tree. This commit detects the particular situation we encountered, and avoids the crash by not creating the `NestedInfo` for the `BType` corresponding to `C#1`. The code comment discusses why I think this is safe, and suggests a refactoring that would mean we only ever try to construct `NestedInfo` when we are going to need them.
* | | | Merge pull request #4622 from retronym/merge/2.11.x-to-2.12.x-20150713Adriaan Moors2015-07-133-5/+5
|\ \ \ \ | | | | | | | | | | Merge 2.11.x to 2.12.x [ci: last-only]
| * \ \ \ Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-07-133-5/+5
| |\ \ \ \ | | |/ / / | |/| / / | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20150713 Conflicts: src/eclipse/partest/.classpath src/eclipse/repl/.classpath test/files/run/nothingTypeNoFramesNoDce.scala test/files/run/repl-javap-app.check Also fixup two .classpath files with updated partest, xml and parser combinators JARs.
| | * | Fix 25 typos (s)Janek Bogucki2015-07-062-2/+2
| | | |
| | * | Fix 27 typos (p-r)Janek Bogucki2015-06-301-3/+3
| | |/
* | | Merge pull request #4621 from retronym/ticket/9393Adriaan Moors2015-07-133-0/+21
|\ \ \ | | | | | | | | SI-9393 Temporarily disable two assertions in GenBCode