summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3389 from retronym/ticket/8134-2Jason Zaugg2014-02-139-107/+0
|\ | | | | SI-8134 SI-5954 Fix companions in package object under separate comp.
| * SI-8134 SI-5954 Fix companions in package object under separate comp.Jason Zaugg2014-01-209-107/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests cases enclosed exhibited two failures modes under separate compilation. 1. When a synthetic companion object for a case- or implicit-class defined in a package object is called for, `Namer#ensureCompanionObject` is used to check for an explicitly defined companion before decided to create a synthetic one. This lookup of an existing companion symbol by `companionObjectOf` would locate a symbol backed by a class file which was in the scope of the enclosing package class. Furthermore, because the owner of that symbol is the package object class that has now been noted as corresponding to a source file in the current run, the class-file backed module symbol is *also* deemed to be from the current run. (This logic is in `Run#compiles`.) Thinking the companion module already existed, no synthetic module was created, which would lead to a crash in extension methods, which needs to add methods to it. 2. In cases when the code explicitly contains the companion pair, we still ran into problems in the backend whereby the class-file based and source-file based symbols for the module ended up in the same scope (of the package class). This tripped an assertion in `Symbol#companionModule`. We get into these problems because of the eager manner in which class-file based package object are opened in `openPackageModule`. The members of the module are copied into the scope of the enclosing package: scala> ScalaPackage.info.member(nme.List) res0: $r#59116.intp#45094.global#28436.Symbol#29451 = value List#2462 scala> ScalaPackage.info.member(nme.PACKAGE).info.member(nme.List) res1: $r#59116.intp#45094.global#28436.Symbol#29451 = value List#2462 This seems to require a two-pronged defense: 1. When we attach a pre-existing symbol for a package object symbol to the tree of its new source, unlink the "forwarder" symbols (its decls from the enclosing package class. 2. In `Flatten`, in the spirit of `replaceSymbolInCurrentScope`, remove static member modules from the scope of the enclosing package object (aka `exitingFlatten(nestedModule.owner)`). This commit also removes the warnings about defining companions in package objects and converts those neg tests to pos (with -Xfatal-warnings to prove they are warning free.) Defining nested classes/objects in package objects still has a drawback: you can't shift a class from the package to the package object, or vice versa, in a binary compatible manner, because of the `package$` prefix on the flattened name of nested classes. For this reason, the `-Xlint` warning about this remains. This issue is tracked as SI-4344. However, if one heeds this warning and incrementatlly recompiles, we no longer need to run into a DoubleDefinition error (which was dressed up with a more specific diagnostic in SI-5760.) The neg test case for that bug has been converted to a pos.
* | SI-5900 Fix pattern inference regressionJason Zaugg2014-02-126-36/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit does not close SI-5900. It only addresses a regression in 2.11 prereleases caused by SI-7886. The fix for SI-7886 was incomplete (as shown by the last commit) and incorrect (as shown by the regression in pos/t5900a.scala and the fact it ended up inferring type parameters.) I believe that the key to fixing this problem will be unifying the inference of case class constructor patterns and extractor patterns. I've explored that idea: https://gist.github.com/retronym/7704153 https://github.com/retronym/scala/compare/ticket/5900 But didn't quite get there.
* | Merge pull request #3519 from adriaanm/rebase-3483Adriaan Moors2014-02-1210-0/+84
|\ \ | | | | | | SI-8244 Fix raw type regression under separate compilation
| * | SI-8244 Fix raw type regression under separate compilationJason Zaugg2014-02-1210-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #1901, handling of raw types encountered in signatures during class file parsing was changed to work in the same manner as `classExistentialType`, by using `existentialAbstraction(cls.tparms, cls.tpe_*)` But this never creates fresh existential symbols, and just sticks the class type parameters it `quantified`: scala> trait T[A <: String] defined trait T scala> val cls = typeOf[T[_]].typeSymbol cls = trait T#101864 scala> cls.typeParams res0 = List(type A#101865) scala> cls.tpe_* res1 = T#101864[A#101865] scala> classExistentialType(cls) res3 = T#101864[_ <: String#7209] scala> val ExistentialType(quantified, result) = res3 List(type A#101865) In the enclosed test case, this class type parameter was substituted during `typeOf[X] memberType sym`, which led us unsoundly thinking that `Raw[_]` was `Raw[X]`. I've added a TODO comment to review the other usages of `classExistentialType`. Test variations include joint and separate compilation, and the corresponding Scala-only code. All fail with type errors now, as we expect. I've also added a distillation of a bootstrap error that failed when I forgot to wrap the `existentialType`.
* | | SI-7753 InstantiateDependentMap narrows type of unstable argsAdriaan Moors2014-02-122-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Most of this comment and the initial fix were implemented by Jason Zaugg. I just cleaned it up a bit.] After a soundness fix in SI-3873, instantiation of dependent method type results behaved differently depending on whether the argument from which we were propagating information had a stable type or not. This is particular to substitution into singleton types over the parameter in question. If the argument was stable, it was substituted into singleton types, such as the one below in the prefix in `a.type#B` (which is the longhand version of `a.B`) scala> class A { type B >: Null <: AnyRef } defined class A scala> object AA extends A { type B = String } defined object AA scala> def foo(a: A): a.B = null foo: (a: A)a.B scala> foo(AA) res0: AA.B = null But what if it isn't stable? scala> foo({def a = AA; a: A { type B <: String}}) res1: a.B = null This commit changes that to: scala> foo({def a = AA; a: A { type B <: String}}) res1: A{type B <: String}#B = null
* | Merge pull request #3516 from adriaanm/t8177Adriaan Moors2014-02-124-148/+0
|\ \ | | | | | | SI-8177 co-evolve more than just RefinedTypes
| * | SI-8177 refine embeddedSymbolsAdriaan Moors2014-02-124-148/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | We look for any prefix that has a refinement class for a type symbol. This includes ThisTypes, which were not considered before. pos/t8177g.scala, neg/t0764*scala now compile, as they should Additional test cases contributed by Jason & Paul.
* | | A test case for a name binding progressionJason Zaugg2014-02-122-0/+31
|/ / | | | | | | | | | | | | | | I noticed the change when adapting Slick to work with Scala 2.11 in `AbstractSourceCodeGenerator.scala`. The behaviour changed in a70c8219. This commit locks down the new, correct behaviour with a test.
* | Merge pull request #3503 from adriaanm/rebase-3440Adriaan Moors2014-02-1110-6/+80
|\ \ | | | | | | SI-7475 Private members aren't inheritable, findMember overhaul
| * | SI-7475 Private members are not inheritableJason Zaugg2014-02-1010-6/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out `findMembers` has been a bit sloppy in recent years and has returned private members from *anywhere* up the base class sequence. Access checks usually pick up the slack and eliminate the unwanted privates. But, in concert with the "concrete beats abstract" rule in `findMember`, the following mishap appeared: scala> :paste // Entering paste mode (ctrl-D to finish) trait T { def a: Int } trait B { private def a: Int = 0 } trait C extends T with B { a } // Exiting paste mode, now interpreting. <console>:9: error: method a in trait B cannot be accessed in C trait C extends T with B { a } ^ I noticed this when compiling Akka against JDK 8; a new private method in the bowels of the JDK was enough to break the build! It turns out that some finesse in needed to interpret SLS 5.2: > The private modifier can be used with any definition or declaration > in a template. They are not inherited by subclasses [...] So, can we simply exclude privates from all but the first base class? No, as that might be a refinement class! The following must be allowed: trait A { private def foo = 0; trait T { self: A => this.foo } } This commit: - tracks when the walk up the base class sequence passes the first non-refinement class, and excludes private members - ... except, if we are at a direct parent of a refinement class itself - Makes a corresponding change to OverridingPairs, to only consider private members if they are owned by the `base` Symbol under consideration. We don't need to deal with the subtleties of refinements there as that code is only used for bona-fide classes. - replaces use of `hasTransOwner` when considering whether a private[this] symbol is a member. The last condition was not grounded in the spec at all. The change is visible in cases like: // Old scala> trait A { private[this] val x = 0; class B extends A { this.x } } <console>:7: error: value x in trait A cannot be accessed in A.this.B trait A { private[this] val x = 0; class B extends A { this.x } } ^ // New scala> trait A { private[this] val x = 0; class B extends A { this.x } } <console>:8: error: value x is not a member of A.this.B trait A { private[this] val x = 0; class B extends A { this.x } } ^ Furthermore, we no longer give a `private[this]` member a free pass if it is sourced from the very first base class. trait Cake extends Slice { private[this] val bippy = () } trait Slice { self: Cake => bippy // BCS: Cake, Slice, AnyRef, Any } The different handling between `private` and `private[this]` still seems a bit dubious. The spec says: > An different form of qualification is private[this]. A member M > marked with this modifier can be accessed only from within the > object in which it is defined. That is, a selection p.M is only > legal if the prefix is this or O.this, for some class O enclosing > the reference. In addition, the restrictions for unqualified > private apply. This sounds like a question of access, not membership. If so, we should admit `private[this]` members from parents of refined types in `FindMember`. AFAICT, not too much rests on the distinction: do we get a "no such member", or "member foo inaccessible" error? I welcome scrutinee of the checkfile of `neg/t7475f.scala` to help put this last piece into the puzzle. One more thing: findMember does not have *any* code the corresponds to the last sentence of: > SLS 5.2 The modifier can be qualified with an identifier C > (e.g. private[C]) that must denote a class or package enclosing > the definition. Members labeled with such a modifier are accessible > respectively only from code inside the package C or only from code > inside the class C and its companion module (§5.4). > Such members are also inherited only from templates inside C. When I showed Martin this, he suggested it was an error in the spec, and we should leave the access checking to callers of that inherited qualified-private member.
* | | Add a great test case.Paul Phillips2014-02-112-0/+127
|/ / | | | | | | | | | | Created to convince moors that certain code should compile, it wound up flushing out some quite nutty behavior. Some day this will compile rather than having an 11-failure checkfile.
* | SI-8129 Make Object#== override Any#==Jason Zaugg2014-02-102-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And the same for != If we tried to declare these signatures in non-fictional classes, we would be chastised about collapsing into the "same signature after erasure". This will have an influence of typing, as the typechecking of arguments is sensitive to overloading: if multiple variants are feasible, the argument will be typechecked with a wildcard expected type. So people inspecting the types of the arguments to `==` before this change might have seen an interesting type for `if (true) x else y`, but now the `If` will have type `Any`, as we don't need to calculate the LUB. I've left a TODO to note that we should really make `Any#{==, !=}` non-final and include a final override in `AnyVal`. But I don't think that is particularly urgent.
* | Merge pull request #3428 from retronym/ticket/6260Grzegorz Kossakowski2014-02-1010-72/+28
|\ \ | | | | | | SI-6260 Avoid double-def error with lambdas over value classes
| * | SI-6260 Adddress pull request reviewJason Zaugg2014-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - fix typo - remove BRIDGE flag from the method that we promote from a bridge to a bona-fide method - note possibility for delambdafy to avoid the bridge method creation in *all* cases. - note inconsistency with anonymous class naming between `-Ydelamdafy:{inline,method}`
| * | SI-6260 Avoid double-def error with lambdas over value classesJason Zaugg2014-02-1010-72/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Post-erasure of value classs in method signatures to the underlying type wreaks havoc when the erased signature overlaps with the generic signature from an overriden method. There just isn't room for both. But we *really* need both; callers to the interface method will be passing boxed values that the bridge needs to unbox and pass to the specific method that accepts unboxed values. This most commonly turns up with value classes that erase to Object that are used as the parameter or the return type of an anonymous function. This was thought to have been intractable, unless we chose a different name for the unboxed, specific method in the subclass. But that sounds like a big task that would require call-site rewriting, ala specialization. But there is an important special case in which we don't need to rewrite call sites. If the class defining the method is anonymous, there is actually no need for the unboxed method; it will *only* ever be called via the generic method. I came to this realisation when looking at how Java 8 lambdas are handled. I was expecting bridge methods, but found none. The lambda body is placed directly in a method exactly matching the generic signature. This commit detects the clash between bridge and target, and recovers for anonymous classes by mangling the name of the target method's symbol. This is used as the bytecode name. The generic bridge forward to that, as before, with the requisite box/unbox operations.
* | | Merge pull request #3476 from retronym/ticket/8207Adriaan Moors2014-02-092-0/+10
|\ \ \ | | | | | | | | SI-8207 Allow import qualified by self reference
| * | | SI-8207 Allow import qualified by self referenceJason Zaugg2014-02-062-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This regressed in SI-6815 / #2374. We check if the result of `typedQualifier(Ident(selfReference))` is a stable identifier pattern. But we actually see the expansion to `C.this`, which doesn't qualify. This commit adds a special cases to `importSig` to compensate. This is safe enough, because the syntax prevents the following: scala> class C { import C.this.toString } <console>:1: error: '.' expected but '}' found. class C { import C.this.toString } ^ So loosening the check here doesn't admit invalid programs. I've backed this up with a `neg` test. The enclosed test also checks that we can use the self reference in a singleton type, and as a qualifier in a type selection (These weren't actually broken.) Maybe it would be more principled to avoid expanding the self reference in `typedIdent`. I can imagine that the current situation is a pain for refactoring tools that try to implement a rename refactoring, for example. Seems a bit risky at the minute, but I've noted the idea in a comment.
* | | | Merge pull request #3484 from retronym/ticket/8237Adriaan Moors2014-02-093-1/+43
|\ \ \ \ | |_|/ / |/| | | SI-8237 Avoid cyclic constraints when inferring hk type args
| * | | SI-8237 Avoid cyclic constraints when inferring hk type argsJason Zaugg2014-02-093-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An `AppliedTypeVars` spawned from `HKTypeVar#applyArgs` (necessarily) shares the same `TypeConstraints`. But, we can have multiple ATVs based on a single HKTV floating around during inference, and they can appear on both sides of type relations. An example of this is traced out in the enclosed test. This commit avoids registering upper/lower bound constraints when this is detected. In the enclosed test, we end up with an empty set of constraints for `?E`, which results in inference of Nothing, which is what we expect. I have also improved the printing of ATVs (to include the args) and sharpened the log message when `solve` leaves type variables instantiated to `NoType`, rather than some other type that doesn't conform to the bounds. Both of these changes helped me to get to the bottom of this ticket. The improved `ATV#toString` shows up in some updated checkfiles. The reported test has quite a checkered history: - in 2.10.0 it worked, but more by good luck than good planning - after the fix for SI-7226 / 221f52757aa6, it started crashing - from 3bd897ba0054f (a merge from 2.10.x just before 2.11.0-M1) we started getting a type inference failure, rather than a crash. "no type parameters for method exists [...] because cyclic instantiation". - It still crashes in `isGround` in 2.10.3.
* | | | Merge pull request #3420 from som-snytt/issue/8092-f-parsingEugene Burmako2014-02-093-20/+167
|\ \ \ \ | |/ / / |/| | | SI-8092 More verify for f-interpolator
| * | | SI-8092 Refactor f-interpSom Snytt2014-02-042-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A denshish refactor makes the FormatInterpolator a nice bundle that destructures its input and flattens out the classes to give the code some elbow room. Everything shifts left. The `checkType` method is refolded and renamed `pickAcceptable`. An additional test case captures the leading edge test, that a % should follow a hole, and which is the most basic requirement.
| * | | SI-8092 More verify for f-interpolatorSom Snytt2014-01-283-20/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attempt to verify the nooks and crannies of the format string. Allows all syntax in the javadoc, including arg indexes. If the specifier after an arg has an index that doesn't refer to the arg, a warning is issued and the missing `%s` is prepended (just as for a part with a leading `%n`). Other enhancements include detecting that a `Formattable` wasn't supplied to `%#s`. Error messages attempt to be pithy but descriptive.
* | | | Merge pull request #3457 from retronym/ticket/8228Adriaan Moors2014-02-052-0/+11
|\ \ \ \ | | | | | | | | | | SI-8228 Avoid infinite loop with erroneous code, overloading
| * | | | SI-8228 Avoid infinite loop with erroneous code, overloadingJason Zaugg2014-02-022-0/+11
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `isApplicableBasedOnArity` couldn't get of the ferris wheel after as `followApply` kept insisting on another spin. scala> ErrorType nonPrivateMember nme.apply res0: $r.intp.global.Symbol = value apply scala> res0.info res1: $r.intp.global.Type = <error> This commit makes `followApply` consider that an `ErrorType` does not contain an `apply` member. I also considered whether to do a deep check on the type (`isErroneous`), but I can't motivate this with a test. I tend to think we *shouldn't* do that: `List[${ErrorType}]` still has an `apply` member that we should follow, right?
* | | | Fix typo in compiler's error message: anoynmous => anonymousPavel Pavlov2014-02-051-3/+3
| | | |
* | | | Merge pull request #3357 from retronym/ticket/8143Adriaan Moors2014-01-314-2/+34
|\ \ \ \ | |/ / / |/| | | SI-8143 Regressions with override checks, private members
| * | | SI-8143 Regressions with override checks, private membersJason Zaugg2014-01-144-2/+34
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These regressed in e609f1f20b, which excluded all private methods from overriding checks. We should only exclude private[this] members on the low end of a pair, as was done before that commit, and, we must also exclude private members on the high side. Why? Warning: reverse engineered intuition follows. We need to report an error when if a private method in a subclass has matches a less-private method in the super class and report an error, lest the user be fooled into thinking it might be invoked virtually. On the other hand, adding a private method to a super class shouldn't invalidate the choice names of public members in its superclasses. I've removed the test case added by that commit and will lodge a reworked version of it that Paul provided as a new issue. That shows a bug with qualified private + inheritance. In addition, the expectation of `neg/accesses.check` is reverted to its 2.10.3 version, which I believe is correct. When it was changed in e609f1f20b it sprouted a variation, `neg/accesses-2`, which has now changed behaviour. The intent of that test will be captured in the aforementioned issue covering qualified private inheritance.
* | | Merge pull request #3416 from retronym/topic/any-val-implicitAdriaan Moors2014-01-303-22/+38
|\ \ \ | | | | | | | | Prohibit views targeting AnyVal
| * | | Prohibit views targeting AnyValJason Zaugg2014-01-273-22/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Library changes in Scala 2.10 mean that we are left with the unfortunate situation of admitting: scala> "": AnyVal res0: AnyVal = We already have explicit checks in place to prevent views targeting `AnyRef`. This commit balances this out by prohibiting `AnyVal`, as well. The enclosed test shows that this case is now prevented. If multiple implicits views are applicable, the ambiguity error is still raised; these check comes right at the end. Maybe that ought to be changed, but I don't think it matters too much. I've also disabled this prohibition under -Xsource:2.10.
* | | | Merge pull request #3374 from densh/si/6844-8076Jason Zaugg2014-01-294-2/+17
|\ \ \ \ | | | | | | | | | | SI-6844 SI-8076 improve handling of function parameters in quasiquotes
| * | | | SI-6844 restrict splicing in parameter positionDenys Shabalin2014-01-164-2/+17
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously were a bit too permissive on how splicing in function parameter position worked. This made confusing things like possible: val x = TermName(“x”) q”def foo($x)” Now you can either splice trees in that position (ValDefs) or you have to provide type if you splice a name.
* | | | SI-8182 Avert crash due to type args in patternSom Snytt2014-01-272-0/+40
| | | | | | | | | | | | | | | | | | | | Error out type args on binary op after emitting error. Let the parse limp into the whirring blades.
* | | | Merge pull request #3404 from gkossakowski/java8-supportGrzegorz Kossakowski2014-01-242-5/+9
|\ \ \ \ | |_|_|/ |/| | | Preliminary support for building and testing with Java 8
| * | | Make abstract-report2 test less dependent on std library.Grzegorz Kossakowski2014-01-212-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the use of `Ordering` by custom, dummy trait Xyz defined in test's source. By not inheriting from Ordering in abstract-report2 we make the test less dependent on both Scala and Java library. The reason we are less dependent on Java is because Ordering extends Java's comparator. This change is motivated by the fact that Java 8 introduced default method `reversed` to Comparator interface and we get a failure due to conflicting inheritance: -abstract-report2.scala:9: error: trait Bippy inherits conflicting members: - method reversed in trait TraversableOnce of type => List[(T2, String)] and - method reversed in trait Comparator of type ()java.util.Comparator[T3] -(Note: this can be resolved by declaring an override in trait Bippy.) -trait Bippy[T1, T2, T3] extends Collection[T1] with TraversableOnce[(T2, String)] with Ordering[T3] - ^
* | | | addresses pull request feedbackEugene Burmako2014-01-201-1/+1
| | | |
* | | | SI-8158 compiler hangs printing out fancy typesEugene Burmako2014-01-203-0/+52
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, even though the compiler has safeguards against infinite type printouts, having a depth counter, we didn’t account for the cases when printouts are both self-referential and self-multiplying. For one, SI-8158 provides an example of such a type, which is a structural type that refers to itself twice in return types of its methods. At first, printing such a type would go deeper and deeper, but then it will hit the depth limit and start multiply indefinitely. This commit fixes this particular problem by recognizing self-references as this.type’s and printing them out as such. The subsequent commit will introduce a more general facility.
* | | Merge commit 'aefe3fb844' into merge-2.10.xAdriaan Moors2014-01-172-0/+12
|\ \ \
| * | | SI-6563 Test case for already-fixed crasherJason Zaugg2014-01-062-0/+12
| | | | | | | | | | | | | | | | Progressed to working in SI-7636 / c4bf1d5.
| * | | [nomaster] codifies the state of the art wrt SI-8104Eugene Burmako2013-12-286-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it was discovered in SI-8104, whiteboxity doesn’t apply equally to type parameters and type members of materialized type classes. During implicit search and subsequent type inference, whitebox type parameters are consistently erased to wildcards, whereas whitebox type members sometimes remain as is and get in the way of signature conformance checks. Unfortunately, 2.10.x can’t make use of type parameter whiteboxity, because it requires fundep materializers that were only merged into 2.11: https://github.com/scala/scala/pull/2499, and therefore Si-8104 seems to be a hard blocker for 2.10.x at the moment. Stay tuned for updates.
* | | | Merge commit '97b9b2c06a' from 2.10.x into masterAdriaan Moors2014-01-172-12/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check files updated: test/files/presentation/t8085*.check Conflicts: build.xml src/compiler/scala/tools/nsc/ast/parser/Parsers.scala src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
| * | | Revert "SI-6426, importable _."Adriaan Moors2013-12-102-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d2316df920ffa4804fe51e8f8780240c46efa982. We can't make `_` an illegal identifier -- it's legal in Java, so we must be able to name these Java underscores.
| * | | [nomaster] better error messages for various macro definition errorsEugene Burmako2013-12-0618-24/+18
| | | | | | | | | | | | | | | | backport of 1d3ec4e708154ec05554f540d7d68ed55dc12426
* | | | Merge pull request #3380 from retronym/ticket/8157Adriaan Moors2014-01-172-0/+8
|\ \ \ \ | | | | | | | | | | Make overloading, defaults restriction PolyType aware
| * | | | SI-8157 Make overloading, defaults restriction PolyType awareJason Zaugg2014-01-172-0/+8
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Named/Default args levies an implementation restriction that only one overloaded alternative may declare defaults. But, this restriction failed to consider polymorphic methods. Rather than matching on MethodType, this commit uses `Type#paramms`, which handles PolyTypes and curried MethodTypes in one fell swoop.
* | | | Merge pull request #3283 from paulp/pr/dotless-targsAdriaan Moors2014-01-172-0/+9
|\ \ \ \ | |/ / / |/| | | Dotless type application for infix operators.
| * | | Dotless type application for infix operators.Paul Phillips2013-12-172-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have an aesthetic expresion like def f(xs: Iterator[Int]) = ( xs takeWhile (_ < 1000) map (_ * -1) filter (_ % 2 == 0) flatMap (x => List(x, x)) reduceOption (_ + _) maxBy (_.toString) ) And then for whatever reason you have to perform explicit type application in the midst of that expression, it's aggravating in the extreme that it has (had) to be rewritten in its entirety to accommodate that change. So now you can perform type application in the middle of it. For reasons not entirely clear to me postfix operators are excluded. The discussion as well as the approval for the infix variation of it can be found at: https://groups.google.com/forum/#!msg/scala-language/eJl1wnkEz9M/hR984-lqC5EJ
* | | | Merge pull request #3293 from soc/SI-7469Adriaan Moors2014-01-152-2/+2
|\ \ \ \ | | | | | | | | | | Remove misc. @deprecated elements
| * | | | SI-7469 Remove misc. @deprecated elementsSimon Ochsenreither2014-01-092-2/+2
| | | | |
* | | | | Merge pull request #3285 from som-snytt/issue/8015-FF-NLsAdriaan Moors2014-01-155-0/+32
|\ \ \ \ \ | | | | | | | | | | | | Count lines by EOLs