summaryrefslogtreecommitdiff
path: root/test/files/pos
Commit message (Collapse)AuthorAgeFilesLines
* Cull extraneous whitespace.Paul Phillips2013-09-18263-604/+590
| | | | | | | | | | | | | | | | | | | | | 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-7847 Static forwarders for case apply/unapplyJason Zaugg2013-09-162-0/+15
| | | | | | | | | | | | | | These were excluded in f901816b3f because at the time they were compiler fiction and translated to calls to the case class constructor or accessors. But since they are now bona-fide methods (albeit still occasionally bypassed as an optimization), we can expose them conveniently to our Java brethren. The cut-and-pastiness of GenBCode starts to hinder maintenance. Here's a report of further duplication that we have to fix up post haste: https://gist.github.com/retronym/6334389
* Merge pull request #2884 from retronym/ticket/3832Jason Zaugg2013-09-152-14/+0
|\ | | | | SI-1909 SI-3832 SI-7007 SI-7223 Improved handling of larval objects
| * SI-1909 Move tests from pos to runJason Zaugg2013-09-112-14/+0
| | | | | | | | | | | | | | | | When we're in the neighbourhood of VerifyErrors, it's better to run the code. This change is leading up to a fix for SI-3832, which regressed with fix for SI-1909.
* | Corrects behavior of finalResultType.Paul Phillips2013-09-132-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | The implementation had come to depend on finalResultType accidentally doing things beyond its charter - in particular, widening types. After hunting down and fixing the call sites depending on the bugs, I was able to rewrite the method to do only what it's supposed to do. I threw in a different way of writing it entirely to suggest how some correctness might be obtained in the future. It's a lot harder for a method written like this to break.
* | Merge pull request #2928 from retronym/merge/2.10.x-to-masterGrzegorz Kossakowski2013-09-121-0/+10
|\ \ | | | | | | merge 2.10.x to master
| * \ Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-masterJason Zaugg2013-09-101-0/+10
| |\ \ | | |/ | |/| | | | | | | Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
| | * SI-7818 Cast our way out of extended existential angstJason Zaugg2013-09-061-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `substituteSymbols` is not sophisticated enough to operate on `TypeSkolem`-s which are based on one of the "from" symbols. The pertinant usage of `substituteSymbols` for this bug in in `Extender`. Recapping on that transform: // orig class C[T](...) extends AnyVal { def foo[U] = <rhs> } // transform class C[T] extends AnyVal { ... } object C { def foo$extension[T', U'] = <rhs'> } Where `<rhs'>` has been subtituted with, among other things, `[T, U] ~> [T', U']`. In this case our expected type contains a new type parameter (of the extension method), whereas the type of the RHS contains an existential skolem still pinned to the corresponding class type parameter. tree.tpe = Observable1#7037[_$1#12344] <_$1#12344>.info = <: T#7040 pt = Observable1#7037[T#15644] The limitation of substution is lamented in the comments of `adaptMismatchedSkolems`, which faces the harder version of the issue where the skolems are in the expected type. But, we're in the "easy" case with the skolems in the tree's type; we can cast our way out of the problem. See also f335e447 / ed915c54.
* | | SI-7834 Type equivalence of C.this and C.super.Paul Phillips2013-09-111-0/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Foo.this.x and Foo.super.x were roughly unrelated in the eyes of isSubType. I implemented conformance as described in the comment: This is looking for situations such as B.this.x.type <:< B.super.x.type. If it's a ThisType on the lhs and a SuperType on the right, and they originate in the same class, and the 'x' in the ThisType has in its override chain the 'x' in the SuperType, then the types conform. I think this is overly conservative but it's way ahead of where it was.
* | Merge pull request #2855 from adriaanm/modularize-xml-parsersv2.11.0-M5Grzegorz Kossakowski2013-09-0617-295/+0
|\ \ | | | | | | Modularize: xml & parser-combinators
| * | Prepare removal of scala-xml, scala-parser-combinatorsAdriaan Moors2013-08-2717-295/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-053-0/+84
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | 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 #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.
| * | | 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.
* | | | Merge pull request #2886 from gkossakowski/merge-2.10.xJason Zaugg2013-08-309-0/+101
|\ \ \ \ | | | | | | | | | | Merge 2.10.x into master
| * | | | Merge remote-tracking branch 'scala/2.10.x'Grzegorz Kossakowski2013-08-299-0/+101
| |\| | | | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2610-35/+69
| | |\ \ | | | |/ | | |/| Merge/2.10.2 to 2.10.x
| | | * SI-7486 More tests for cycles triggered by implicit searchJason Zaugg2013-08-212-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2110-43/+61
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better late than never. Conflicts: src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
| | * | | SI-942 A test case, five years adrift.Jason Zaugg2013-08-232-0/+8
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | 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 #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.
| | * | | SI-7694 Add @uncheckedBounds to the libraryJason Zaugg2013-08-131-0/+40
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | / / SI-7785 Preserve TypeVar suspension through TypeMapsJason Zaugg2013-08-271-0/+34
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During `findMember`, TypeVars in `this` are placed into suspended animation. This is to avoid running into recursive types when matching members to those in base classes. However, the mechanism used to do this is superficial, and doesn't work when TypeVars are copied by TypeMaps. This seems to crop up when using `AppliedTypeVar` with higher-kinded type vars. In the enclosed test case, the cyclic type led to a SOE in CommonOwnerMap. This commit allows a TypeVar to delegate its `suspended` attribute to the TypeVar from which it was copied. This is done in `TypeVar#applyArgs`, which is called by: // TypeMap#mapOver case tv@TypeVar(_, constr) => if (constr.instValid) this(constr.inst) else tv.applyArgs(mapOverArgs(tv.typeArgs, tv.params)) We should review the other places this is called to make sure that it make sense to link in this way: Types#appliedType TypeVar#normalize
* | | Merge branch 'master' into patmatPaul Phillips2013-08-201-0/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
| * | | 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."
* | | | 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.
* | | | New tests for name-based pattern matcher.Paul Phillips2013-08-173-0/+71
| | | |
* | | | Pattern matcher: extractors become name-based.Paul Phillips2013-08-171-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An extractor is no longer required to return Option[T], and can instead return anything which directly contains methods with these signatures: def isEmpty: Boolean def get: T If the type of get contains methods with the names of product selectors (_1, _2, etc.) then the type and arity of the extraction is inferred from the type of get. If it does not contain _1, then it is a single value extractor analogous like Option[T]. This has significant benefits and opens new territory: - an AnyVal based Option-like class can be used which leverages null as None, and no allocations are necessary - for primitive types the benefit is squared (see below) - the performance difference between case classes and extractors should now be largely eliminated - this in turn allows us to recapture great swaths of memory which are currently squandered (e.g. every TypeRef has fields for pre and args, even though these are more than half the time NoPrefix and Nil) Here is a primitive example: final class OptInt(val x: Int) extends AnyVal { def get: Int = x def isEmpty = x == Int.MinValue // or whatever is appropriate } // This boxes TWICE: Int => Integer => Some(Integer) def unapply(x: Int): Option[Int] // This boxes NONCE def unapply(x: Int): OptInt As a multi-value example, after I contribute some methods to TypeRef: def isEmpty = false def get = this def _1 = pre def _2 = sym def _3 = args Then it's extractor becomes def unapply(x: TypeRef) = x Which, it need hardly be said, involves no allocations.
* | | Merge pull request #2804 from adriaanm/rebase-2763Adriaan Moors2013-08-121-0/+17
|\ \ \ | | | | | | | | SI-7690 ghost error message fails compile [Rebase of #2763]
| * | | SI-7690 ghost error message fails compilePaul Phillips2013-08-111-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | I won't even try to explain the error reporting code, because it would have no basis in reality. However this change appears to fix the symptom reported.
* | | | Fix N^2 spot in erasure.Paul Phillips2013-08-051-0/+35
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An expression containing nested casts would type the same tree 2^N times where N is the number of nested casts. This was particularly visible in Vector.scala where one can find a six-cast expression. It's currently line "why was six afraid of seven", aka line 789. display5((index >> 25) & 31) .asInstanceOf[Array[AnyRef]]((index >> 20) & 31) .asInstanceOf[Array[AnyRef]]((index >> 15) & 31) .asInstanceOf[Array[AnyRef]]((index >> 10) & 31) .asInstanceOf[Array[AnyRef]]((index >> 5) & 31) .asInstanceOf[Array[AnyRef]](index & 31) .asInstanceOf[T] Compiling Vector.scala, before/after. < #unique types : 10805 > #unique types : 9722 < #created tree nodes : 26716 > #created tree nodes : 25647 I found a similar bug about a year ago in 39f01d4f48. It's interesting to consider how little defense we have against bugs of this nature - visually non-obvious differences in tree traversal can have spectacular impact on complexity.
* | | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-07-292-0/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/reify/phases/Reshape.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/transform/Mixin.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/StdAttachments.scala test/files/neg/macro-override-macro-overrides-abstract-method-b.check test/files/run/t7569.check
| * | Merge pull request #2721 from retronym/ticket/7649Adriaan Moors2013-07-122-0/+21
| |\ \ | | | | | | | | SI-7649 Fix positions for reshaped tag materializers
| | * | SI-7649 Fix positions for reshaped tag materializersJason Zaugg2013-07-112-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to `materializeClassTag[T]` are replaced during reification with `implicitly[ClassTag[T]]` in the `reify` macro. This is done to avoid referring to symbols in scala-compiler.jar. Class- and Type-Tag materialization is treated in the same way. This commit positions the replacement trees to avoid triggering assertions under -Yrangepos.
| * | | SI-7638 Superaccessor lookup after specializationVlad Ureche2013-07-081-0/+51
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash was caused by a symbol lookup to rewire the super calls, done after pickler, but specialization added new traits and new members, thus making the super rewiring impossible. To avoid such problems, this patch moves symbol lookup after specialization, so the changes done by specialization (and miniboxing) become visible to mixin. NOTE: This patch will be followed by a similar patch to master. Review by @adriaanm or @retronym.
* | | Merge pull request #2739 from retronym/ticket/7668Adriaan Moors2013-07-291-0/+12
|\ \ \ | | | | | | | | SI-7668 Better return type inheritance for dep. method types
| * | | SI-7668 Better return type inheritance for dep. method typesJason Zaugg2013-07-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return type inheritance already handles substitution of type parameters of the overriding method for those of the overriding. This commit extends this to do the same for parameter symbols.
* | | | Merge pull request #2690 from soc/SI-7620Adriaan Moors2013-07-291-1/+1
|\ \ \ \ | | | | | | | | | | SI-7620 Remove floating-point-literals-without-digit-after-dot
| * | | | SI-7620 Remove floating-point-literals-without-digit-after-dotSimon Ochsenreither2013-06-281-1/+1
| | | | |
* | | | | Merge pull request #2765 from retronym/ticket/7689Grzegorz Kossakowski2013-07-271-0/+7
|\ \ \ \ \ | | | | | | | | | | | | SI-7689 Fix typing regression with default arguments
| * | | | | SI-7689 Fix typing regression with default argumentsJason Zaugg2013-07-241-0/+7
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regressed in e28c3edda4. That commit encoded upper/lower bounds of Any/Nothing as EmptyTree, which were triggering the .isEmpty check in Namers#TypeTreeSubstitutor and resulting in the default getter having TypeTree() as the return type. This resulted in a "missing parmameter type" error. This commit tightens up that condition to only consider empty TypeTrees (those wrapping null or NoType.)
* / | | | SI-7695 Macro debug output on -explaintypesSom Snytt2013-07-272-8/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It looks like checkConforms should wait for error before using explainTypes, rather than turning on macro debug trace if explaintypes is set. In particular, macro debug output is Console.println instead of reporter.echo or similar, so partest can't test it.
* | | | Merge pull request #2717 from retronym/ticket/6574Adriaan Moors2013-07-101-0/+19
|\ \ \ \ | | | | | | | | | | SI-6574 Support @tailrec for extension methods.
| * | | | SI-6574 Support @tailrec for extension methods.Jason Zaugg2013-07-101-0/+19
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when the body of an extension method is transplanted to the companion object, recursive calls point back to the original instance method. That changes during erasure, but this is too late for tail call analysis/elimination. This commit eagerly updates the recursive calls to point to the extension method in the companion. It also removes the @tailrec annotation from the original method.
* | | | Merge pull request #2713 from VladUreche/issue/7638-masterAdriaan Moors2013-07-101-0/+51
|\ \ \ \ | | | | | | | | | | SI-7638 Superaccessor lookup after specialization
| * | | | SI-7638 Superaccessor lookup after specializationVlad Ureche2013-07-081-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash was caused by a symbol lookup to rewire the super calls, done after pickler, but specialization added new traits and new members, thus making the super rewiring impossible. To avoid such problems, this patch moves symbol lookup after specialization, so the changes done by specialization (and miniboxing) become visible to mixin. Review by @adriaanm or @retronym.
* | | | | Merge pull request #2650 from paulp/issue/6221Adriaan Moors2013-07-081-0/+29
|\ \ \ \ \ | | | | | | | | | | | | SI-6221 inference with Function1 subtypes.