summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* Deprecation of @BeanInfoLukas Rytz2014-05-133-0/+9
|
* Merge pull request #3719 from retronym/ticket/8546Jason Zaugg2014-05-092-3/+1
|\ | | | | SI-8546 Pattern matcher analysis foiled by over-widening
| * SI-8546 Pattern matcher analysis foiled by over-wideningJason Zaugg2014-05-072-3/+1
| | | | | | | | | | | | | | | | | | In the enclosed test, the prefix checkable type `ModuleTypeRef(F2.this, C)` was being inadvertently widened to `ModuleTypeRef(F2[?], C)`. This started after some misguided future-proofing in SI-6771 / 3009916. This commit changes the `dealiasWiden` to a `delias`.
* | Merge pull request #3711 from retronym/ticket/8549-2Jason Zaugg2014-05-082-0/+17
|\ \ | | | | | | SI-8549 Serialization: fix regression with @SerialVersionUID / start enforcing backwards compatibility
| * | SI-6988 Test case for non-literal / non-constant SerialVersionUIDJason Zaugg2014-05-052-0/+17
| |/ | | | | | | | | | | | | The `neg` test was already working since `SerialVersionUID` was changed to a `ClassFileAnnotation`; the `run` test only started working since the recently preceding commit that made a compensatory test in the backend.
* / SI-8325 Accept infix star type outside patternsSom Snytt2014-05-056-0/+51
|/ | | | | | | | | | | | | | | This is a follow-up to SI-5702 which enabled use of `*` in infix notation in patterns. Most of the work is in distinguishing infix from a sequence pattern. Also, do not take backticked star as the repeated parameter marker in postfix position. That is, `Int``*``` is not `Int*` -- I hope double-tick renders as tick. There is not a special use case except that backticks mean "I am an identifier, as is, and not a keyword."
* Merge pull request #3670 from retronym/ticket/8463Jason Zaugg2014-04-212-0/+48
|\ | | | | SI-8463 Avoid unpositioned errors from search for views
| * SI-8463 Avoid unpositioned errors from search for viewsJason Zaugg2014-04-022-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ideally, I'd like to fix this using `saveErrors = false` here to firewall the enclosing context from the ambiguiouty error encountered during implicit search. I originally proposed that patch as a fix for SI-8419 in https://github.com/scala/scala/pull/3460 but withdrew from that approach as I uncovered a deeper bug that meant that we actually shouldn't have even been looking for views in that case. But, this runs into SI-8230 and these failures: test/partest --update-check \ /Users/jason/code/scala/test/files/pos/t2504.scala \ /Users/jason/code/scala/test/files/pos/t4457_1.scala \ /Users/jason/code/scala/test/files/neg/t4457_2.scala Turns out that typechecking the ostensible straight forward application, `Array("abc")`, hinges on us leaking an ambiguity error from `viewExists` to find a path through overload resolution! This commit takes a tiny step forward by using `context.tree` rather than `EmptyTree` as the argument to `inferImplicit`. This avoids unpositioned type errors.
* | Merge pull request #3645 from retronym/ticket/8430Jason Zaugg2014-04-213-0/+60
|\ \ | | | | | | SI-8430 Less non-determinism in patmat exhautiveness warnings
| * | SI-8430 Less non-determinism in patmat exhautiveness warningsJason Zaugg2014-03-243-0/+60
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another mole whacked on the head by using `LinkedHashMap`. Caution: `LinkedHashMap` doesn't preserve its runtime type if you map through the generic interface. I've noted this gotcha as SI-8434. I've structured this patch to enforce that concrete collection with types, which is a good idea anyway. My method to track this down was to place breakpoints in `Hash{Map,Set}`.{foreach,iterator}` to see where that was used from within pattern match translation. This approach was drastically faster than my previous rounds of whack-a-mole. The counter-examples are still a bit off; I'm going to merge that aspect of this ticket with SI-7746, in which we've pinpointed the culpable part of the implementation, but haven't had success in fixing the bug.
* | Merge pull request #3658 from adriaanm/t8450Jason Zaugg2014-04-213-0/+19
|\ \ | | | | | | SI-8450 no "implicit numeric widening" in silent mode
| * | SI-8450 no "implicit numeric widening" in silent modeAdriaan Moors2014-03-263-0/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this fix, we get a second, spurious warning. ``` t8450.scala:5: warning: implicit numeric widening def elapsed: Foo = (System.nanoTime - 100L).foo ^ t8450.scala:11: warning: implicit numeric widening def elapsed: Foo = (System.nanoTime - 100L).foo ^ error: No warnings can be incurred under -Xfatal-warnings. two warnings found one error found ``` By respecting silent contexts, we now get only one. I sneakily fixed similar occurrences without adding a test.
* / SI-8460 Fix regression in divergent implicit recoveryJason Zaugg2014-03-311-1/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implicit search detects likely cycles by looking at the stack of open implicits and checking the same implicit appears twice, and if the second occurrence is trying satisfy an implicit search for a "dominant" type. Originally, this condition immediately failed the entire implicit search. However, since Scala 2.10, this mechanism has been refined to continue searching after the first divergent implicit is detected. If a second divergence is found, we fail immediately. If the followup search fails, we report the first divergence. Otherwise, we take the successful result. This mechanism was originally built around exceptions. This proved to be fragile, and was refactored in SI-7291 / accaa314 to instead use the `Context.errors` to control the process. But, since that change, the pattern of implicits in scalanlp/breeze and Shapeless have been prone to reporting the divergent implicit errors where they used to recover. So long as we left the `DivergentImplictTypeError` that originates from a nested implicit search in `context.errors`, we are unable to successfully typecheck other candidates. This commit instead stashes the first such error away in `DivergentImplicitRecovery`, to clear the way for the alternative path to succeed. We must retain any other divergent implicit errors, as witnessed by test/files/neg/t2031.scala, which loops unless we retain divergent implicit errors that we don't stash in `DivergentImplicitRecovery`.
* SI-8341 minor fixup for comments in testAdriaan Moors2014-03-181-3/+3
|
* SI-8341 Refine handoff of undet. params from implicit searchJason Zaugg2014-03-182-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In SI-7944 / 251c2b93, we discovered that typechecking of an implicit candidate could leave orphaned undetermined type parameters in the implicit search context. This resulted in naked type parameters leaking into implicit expansions. The fix seemed easy: just copy any symbols from `implicitSearchContext.undetparams` to the enclosing context (other than ones in `SearchResult#subst`). However, the test case in this ticket reveals a subtle flaw in that fix: `implicitSerachContext.undetparams` only contains the type params from the most recently typechecked candidate! Why? Implicit search uses the same context to typecheck all plausibly compatible candidates. The typechecking itself is driven by `typedImplicit1`. Side note, that explains the heisenbug behaviour noted in the ticket: Not *all* plausibly implicit candidates are typechecked. If the current 'best' eligible candidate is more specific than the next candidate, we can skip that altogether.Implicit search actually exploits this for performance by ordering the candidates according to usage statistics. This reordering, means that commenting out lines elsewhere in the file changed the behaviour! This commit simply stores the undet. tparams in the `SearchResult`, where it is safe from the vaguries of typechecking other candidates. That makes `Test1` and `Test2` with in the enclosed test case fail uniformly, both with each other, and with an explicit call to the view. This is ostensibly a regression from 2.10.3. To get there, we need an implicit search that has to infer `Nothing` in a covariant position. In 2.10.3, we would just let the `G` out into the wild, which did the right thing for the wrong reasons.
* Merge pull request #3631 from adriaanm/t4492Adriaan Moors2014-03-161-4/+4
|\ | | | | SI-4492 More informative error when class not found on classpath
| * SI-4492 More informative error when class not found on classpathAdriaan Moors2014-03-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Position the error based on Select tree that failed to type check, presumably due to an underlying MissingRequirementError, which has no position. There are lots of other ways we could rewrap a MRE and supplement position info, but that remains TODO. Jason's review comment is recorded in the code. Also try to detect the case of a missing module and provide some advice, as well as linking to the forthcoming 2.11 guide at http://docs.scala-lang.org/overviews/core/scala-2.11.html.
* | SI-8265 Restore 2.10 variance behavior under -Xsource:2.10Paul Phillips2014-03-123-0/+8
|/ | | | | | | Issue deprecation warning under -Xsource:2.10 so time travelers can have an authentic deprecation experience before finding that their unsound code no longer compiles in 2.11. The relevant ticket to the soundness issue is SI-6566.
* SI-8376 Better type printing for Java varargsJason Zaugg2014-03-103-0/+15
| | | | | `T*` rather than `<repeated>[T]`, as we alreday do for Scala repeated parameters.
* Merge pull request #3606 from xeno-by/ticket/8375Jason Zaugg2014-03-1016-7/+73
|\ | | | | SI-8375 saner binary incompat errors for macros
| * Addresses pull request feedbackEugene Burmako2014-03-081-1/+1
| |
| * SI-8375 saner binary incompat errors for macrosEugene Burmako2014-03-0716-7/+73
| | | | | | | | | | | | Inspired by Brian McKenna's RC1 migration experience, this commit improves macro impl binding validation in order to provide more helpful diagnostic for this quite frequent class of errors.
* | SI-8372: unspliceable type printed in error messageGrzegorz Kossakowski2014-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The b8a76f688c6ce2a4c305da064303bb46b53be875 introduced ArrayOps.{unzip, unzip3} methods. Both of those methods have ClassTags as context bounds on their type parameters so they can create (and return) instances of Arrays. The type inference for those methods is supposed to be guided by implicit evidence that T <: (T1, T2) (or T <: (T1, T2, T3) in unzip3 case). However, context bounds are desugared into implicit parameters that prepended in front of implicit parameters declared in source code. That means the implicit evidence won't have a chance to guide type inference because it comes as last implicit parameter. This commit desugars context bounds and puts them at the end of implicit parameter list. This way type inference is guided properly and we get expected compiler errors for missing class tags. The change to parameters order breaks binary compatibility with respect to 2.11.0-RC1. I added filters to our binary compatibility configuration files. We can get rid of them as soon as 2.11.0 is out.
* | Test case for SI-8372: issue with ArrayOps.unzipGrzegorz Kossakowski2014-03-072-0/+17
|/ | | | | This commit merely documents current (suboptimal) error message printed for the code reported in SI-8372. The next commit will fix the problem.
* SI-8285 use correct kind of map for quasiquote positionsDenys Shabalin2014-02-282-1/+18
| | | | | | | Previously mutable.ListMap was used with assumption that it preserved order of inserted elements (but it doesn't). Surprisingly logic that assumed ordered elements worked mosly fine on unordered ones. I guess two bugs can cancel each other out.
* SI-4728 test caseLukas Rytz2014-02-262-0/+18
|
* Merge pull request #3566 from adriaanm/t6455Grzegorz Kossakowski2014-02-253-0/+11
|\ | | | | SI-6455 no longer rewrite .withFilter to .filter
| * SI-6455 under -Xfuture, don't rewrite .withFilter to .filterAdriaan Moors2014-02-243-0/+11
| | | | | | | | | | This has been deprecated for two major releases now, but `filter`'s still preferred over `withFilter` in the wild.
* | Merge pull request #3559 from adriaanm/t1503Grzegorz Kossakowski2014-02-233-0/+17
|\ \ | | | | | | SI-1503 don't assume unsound type for ident/literal patterns
| * | SI-1503 don't assume unsound type for ident/literal patternsAdriaan Moors2014-02-193-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix only kicks in under -Xfuture. We also warn under -Xlint. What type should a variable bound to the value matched by a pattern have? To avoid CCEs, it should be a type that's implied by the matching semantics of the pattern. Usually, the type implied by a pattern matching a certain value is the pattern's type, because pattern matching implies instance-of checks. However, Stable Identifier and Literal patterns are matched using `==`, which does not imply a type for the binder that binds the matched value. The change in type checking due to this fix is that programs that used to crash with a CCE (because we blindly cast to the type of the pattern, which a `==` check does not imply) now get a weaker type instead (and no cast). They may still type check, or they may not. To compensate for this fix, change `case x@Foo => x` to `case x: Foo.type => x`, if it's important that `x` have type `Foo.type`. See also: - SI-4577: matching of singleton type patterns uses `eq`, not `==` (so that the types are not a lie). - SI-5024: patmat strips unused bindings, but affects semantics
* | | Merge pull request #3571 from xeno-by/ticket/8321Adriaan Moors2014-02-2322-2/+478
|\ \ \ | | | | | | | | SI-8321 bundles can't be whitebox
| * | | more tests for macro bundlesEugene Burmako2014-02-2114-0/+238
| | | | | | | | | | | | | | | | | | | | Given the recent glaring oversight in macro bundles, I have to have more tests in order to make sure that things are going to work as they should.
| * | | more helpful bundle error messagesEugene Burmako2014-02-213-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, bundle selection mechanism is pretty picky. If a candidate bundle's parameter isn't either blackbox.Context, whitebox.Context or PrefixType refinement thereof, then it's not a bundle and the user will get a generic error. However we can be a bit more helpful and admit classes that are almost like bundles (looksLikeMacroBundleType), have them fail isMacroBundleType, and then emit a much prettier error message to the user that would tell them that bundles must be monomorphic and their sole parameter should not just be any subtype of blackbox.Context or whitebox.Context.
| * | | prohibits polymorphic bundlesEugene Burmako2014-02-214-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | It's not like they were inducing bugs, but I can't see how polymorphism can be useful for macro bundles, hence imho it's better to reduce the number of degrees of freedom of the system.
| * | | bundles now reject invalid context typesEugene Burmako2014-02-214-0/+32
| | | | | | | | | | | | | | | | | | | | Vanilla macros only allow blackbox.Context, whitebox.Context and PrefixType refinements thereof. Bundles should behave in the same way.
| * | | SI-8321 whitebox bundles are now recognized as suchEugene Burmako2014-02-213-0/+144
| | | | | | | | | | | | | | | | | | | | whitebox.Context <: blackbox.Context, so in order to check for blackboxity it's not enough to check whether the context used is <: blackbox.Context.
* | | | Merge pull request #3563 from adriaanm/t5479Grzegorz Kossakowski2014-02-222-2/+6
|\ \ \ \ | |/ / / |/| | | SI-5479 deprecate DelayedInit outside of App
| * | | SI-5479 link to release notes instead of jira queryAdriaan Moors2014-02-201-2/+2
| | | |
| * | | SI-5479 deprecate DelayedInit outside of AppAdriaan Moors2014-02-192-2/+6
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DelayedInit's semantics are way too surprising. For example, it delays initialization of fields, so that fields on objects that extend `App` (which `extends DelayedInit`) are not initialized until the `main` method is called. For more details and a proposed alternative, see https://issues.scala-lang.org/browse/SI-4330?jql=labels%20%3D%20delayedinit%20AND%20resolution%20%3D%20unresolved. Support for `App` will continue -- we'll special case it.
* | | Merge pull request #3555 from adriaanm/rebase-3553Jason Zaugg2014-02-214-2/+12
|\ \ \ | | | | | | | | Small Predef cleanup
| * | | SI-8229 Source compatible name for implicit any2stringaddJason Zaugg2014-02-184-2/+12
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | To support the established pattern for disabling it for an compilation unit. Update scaladoc's knowledge of our "typeclasses". Leave a `private[scala]` version of `StringAdd` (public in bytecode) to ensure binary compatibility with 2.11.0-M8 for partest.
* | | Merge pull request #3564 from adriaanm/t6675Jason Zaugg2014-02-212-2/+2
|\ \ \ | | | | | | | | SI-6675 deprecation warning for auto-tupling in patterns
| * | | SI-6675 deprecation warning for auto-tupling in patternsAdriaan Moors2014-02-192-2/+2
| | |/ | |/| | | | | | | | | | NOTE: when the deprecation warning becomes an error, SI-6111 must become a `won't fix`
* / | Fix quasiquote terminology to be consistent with SchemeDenys Shabalin2014-02-203-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Rename cardinality into rank. Shorter word, easier to understand, more appropriate in our context. 2. Previously we called any dollar substitution splicing but this is not consistent with Scheme where splicing is substitution with non-zero rank. So now $foo is unquoting and ..$foo and ...$foo is unquote splicing or just splicing. Correspondingly splicee becomes unquotee. 3. Rename si7980 test into t7980
* | Merge pull request #3452 from xeno-by/topic/palladium0Jason Zaugg2014-02-1910-10/+62
|\ \ | |/ |/| SI-8063 and its seventy friends
| * tests for SI-8300Eugene Burmako2014-02-182-0/+23
| | | | | | | | | | | | Highlights the dilemma with rich type members in the cake that no longer exists. One used to have to choose between overloading or patmat/extmeth friendliness, but couldn't have both. Thanks to retronym we can have it all.
| * Merge remote-tracking branch 'origin/master' into topic/palladium0Eugene Burmako2014-02-176-112/+15
| |\
| * \ Merge remote-tracking branch 'origin/master' into topic/palladium0Eugene Burmako2014-02-1618-17/+428
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/reflect/macros/compiler/Resolvers.scala src/compiler/scala/reflect/macros/contexts/Typers.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/reflect/scala/reflect/api/BuildUtils.scala
| * | | some renamingsEugene Burmako2014-02-154-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It’s almost 1am, so I’m only scratching the surface, mechanistically applying the renames that I’ve written down in my notebook: * typeSignature => info * declarations => decls * nme/tpnme => termNames/typeNames * paramss => paramLists * allOverriddenSymbols => overrides Some explanation is in order so that I don’t get crucified :) 1) No information loss happens when abbreviating `typeSignature` and `declarations`. We already have contractions in a number of our public APIs (e.g. `typeParams`), and I think it’s fine to shorten words as long as people can understand the shortened versions without a background in scalac. 2) I agree with Simon that `nme` and `tpnme` are cryptic. I think it would be thoughtful of us to provide newcomers with better names. To offset the increase in mouthfulness, I’ve moved `MethodSymbol.isConstructor` to `Symbol.isConstructor`, which covers the most popular use case for nme’s. 3) I also agree that putting `paramss` is a lot to ask of our users. The double-“s” convention is very neat, but let’s admit that it’s just weird for the newcomers. I think `paramLists` is a good compromise here. 4) `allOverriddenSymbols` is my personal complaint. I think it’s a mouthful and a shorter name would be a much better fit for the public API.
| * | | Merge remote-tracking branch 'origin/master' into topic/palladium0Eugene Burmako2014-02-1436-179/+186
| |\ \ \