summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* SI-6902 Check unreachability under @uncheckedJason Zaugg2013-01-193-0/+34
| | | | | | | | | | | Only exhaustiveness checking should be disabled if the scrutinee of a match as annotated as `: @unchecked`. This was the pre-2.10.x behaviour. This also fixes a variation of the closed ticket, SI-6011. The exhaustiveness check is needed to safely fallback from emitting a table switch if duplicate cases are detected.
* Remove -deprecation from partest default options.Paul Phillips2012-12-277-3/+7
| | | | | | | Who knows why it was ever like this; it's not like anyone sees the deprecation warnings. In PR #1807 there is now a test which depends on partest not making this move, so it's a good time to finally expunge it.
* SI-6829, SI-6788, NPEs during erroneous compilation.Paul Phillips2012-12-244-0/+112
| | | | | | Have to intercept trees which have a null type due to errors before they leave the warm confines of 'def typed' because from that point everything assumes tree.tpe != null.
* Merge pull request #1778 from JamesIry/p_SI-6795_2.10.xAdriaan Moors2012-12-192-0/+7
|\ | | | | SI-6795 simplify "abstract override" errors on type members
| * SI-6795 Simplify errors related to "abstract override" on type membersJames Iry2012-12-102-2/+2
| | | | | | | | | | | | Instead of saying "only allowed on non-type members of traits" use separate errors for "not allowed on types" and "only allowed on members of traits"
| * SI-6795 Adds negative check for "abstract override" on types in traitsJames Iry2012-12-102-0/+7
| | | | | | | | | | "abstract override" shouldn't was being allowed on types in traits but the result made no sense and the spec says that shouldn't be allowed.
* | Merge pull request #1709 from retronym/ticket/3995Adriaan Moors2012-12-192-0/+38
|\ \ | | | | | | SI-3995 Exclude companions with an existential prefix.
| * | Expand test with a stably qualified example.Jason Zaugg2012-12-052-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the example below, we need a view from `String => l.F0`, and the companion object `FO` is reachable by a stable, non existentially-bound path. class Lift { def apply(f: F0) {} class F0 object F0 { implicit def f2f0(fn: String): F0 = ??? } } object Test { val l = new Lift l.apply("") // okay } Followup for SI-3995
| * | SI-3995 Exclude companions with an existential prefix.Jason Zaugg2012-12-052-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In `(qual: Q).apply(expr)` where `expr` must be implictily converted to a path dependent type `T` defined in `qual`, we were looking for companion implicits via a path prefixed by an existential skolem `_1`. These aren't much good to us, as when we try to feed them into `mkAttributedQualifer`, a crash rightly ensues. This commit excludes companions prefixed by an existentially bound path.
* | | Merge pull request #1707 from retronym/ticket/5390Adriaan Moors2012-12-178-0/+56
|\ \ \ | | | | | | | | SI-5390 Detect forward reference of case class apply
| * | | SI-5390 Detect forward reference of case class applyJason Zaugg2012-12-048-0/+56
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Refchecks performs (among others) two tasks at once: - detecting forward references - translating `qual.Case(...)` to `new qual.Case(...)` As is often the case with such multi-tasking tree traversals, completion of one task precluded the other.
* | | Merge pull request #1706 from retronym/ticket/5361Adriaan Moors2012-12-153-2/+9
|\ \ \ | | | | | | | | SI-5361 Avoid cyclic type with malformed refinement
| * | | SI-5361 Avoid cyclic type with malformed refinementJason Zaugg2012-12-043-2/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The statement `val x = this` in the refinment type: (new {}): {val x = this} is lazily typechecked, in order to, according to the comment in `typedRefinment, "avoid cyclic reference errors". But the approximate type used ends up with: Refinment@1( parents = [...] decls = { val x: Refinement@1 }) This commit eagerly checks that there is no term definitions in type refinments, rather than delaying this. This changes the error message for SI-3614.
* | | Merge pull request #1742 from scalamacros/ticket/4044Paul Phillips2012-12-121-6/+1
|\ \ \ | | | | | | | | prevents spurious kind bound errors
| * | | prevents spurious kind bound errorsEugene Burmako2012-12-101-6/+1
| | | | | | | | | | | | | | | | | | | | The patch adds a check which makes sure that the trees we're about to report aren't already erroneous.
* | | | Merge pull request #1747 from hubertp/2.10.x-issue/6758Adriaan Moors2012-12-125-22/+84
|\ \ \ \ | | | | | | | | | | Fixes SI-6758: force LazyAnnnotationInfo for DefDef and TypeDef
| * | | | Fixes SI-6758: force LazyAnnnotationInfo for DefDef and TypeDefHubert Plociniczak2012-12-115-22/+84
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | Looks like the change in 25ecde037f22ff no longer forced lazy annotations for some of the cases. Also removed forcing for PackageDef annotations as we currently don't support them.
* | | | Merge pull request #1737 from retronym/ticket/6555Adriaan Moors2012-12-111-2/+2
|\ \ \ \ | |/ / / |/| | | SI-6555 Better parameter name retention
| * | | SI-6555 Better parameter name retentionJason Zaugg2012-12-081-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were losing track of parameter names in two places: 1. Uncurry was using fresh names for the apply method parameters during Function expansion. (The parameter names in the tree were actually correct, they just had synthetic symbols with "x$1" etc.) 2. When adding specialized overrides, the parameter names of the overriden method were used, rather than the parameter names from the overriding method in the class to which we are adding methods. The upshot of this is that when you're stopped in the debugger in the body of, say, `(i: Int) => i * i`, you see `v1` rather than `i`. This commit changes Uncurry and SpecializeTypes to remedy this.
* | | Merge pull request #1691 from retronym/ticket/6558Adriaan Moors2012-12-104-0/+59
|\ \ \ | | | | | | | | SI-6558: typecheck lazy annotation info using non-silent context
| * | | Split test case to workaround incomplete error report.Jason Zaugg2012-12-034-3/+28
| | | | | | | | | | | | | | | | | | | | Reporting some errors prevents reporting others. This residual issue had been lodged as SI-6758.
| * | | SI-6558 Expand test case for annotation typosJason Zaugg2012-12-022-5/+26
| | | |
| * | | Fixes SI-6558: typecheck lazy annotation info using non-silent context.Hubert Plociniczak2012-12-022-0/+13
| | | | | | | | | | | | | | | | Make context for typing lazy annotations always non-silent. If lazy annotation info was created in local (silent) context, error could go unnoticed because later they would still use silent typer for typing the annotation.
* | | | Merge pull request #1711 from retronym/ticket/1672Adriaan Moors2012-12-102-0/+68
|\ \ \ \ | | | | | | | | | | SI-1672 Catches are in tail position without finally.
| * | | | Addtional test cases for tail calls in catches.Jason Zaugg2012-12-052-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Includes a run test to check bytecode verifies and behaves - Show this isn't possible when try is used as an expression, and a `liftedTree` local method is needed.
| * | | | SI-1672 Catches are in tail position without finally.Jason Zaugg2012-12-052-0/+54
| | |_|/ | |/| | | | | | | | | | So we can eliminate tail calls within.
* | | | Merge pull request #1705 from paulp/warn-case-collisionAdriaan Moors2012-12-103-0/+22
|\ \ \ \ | | | | | | | | | | Warn when generated classfiles differ only in case.
| * | | | Warn when generated classfiles differ only in case.Paul Phillips2012-12-053-0/+22
| |/ / / | | | | | | | | | | | | | | | | We should most likely prohibit it completely, but warning is a start.
* | | | Merge pull request #1700 from retronym/ticket/6535Adriaan Moors2012-12-102-0/+21
|\ \ \ \ | | | | | | | | | | SI-6535 Step back from the precipice of a cycle
| * | | | SI-6535 Step back from the precipice of a cycleJason Zaugg2012-12-042-0/+21
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding any non-local parent to WrapAsScala will trigger a valid cyclic reference error. By moving the import of `Wrapper._` inside `WrapAsScala` and `WrapAsJava`, it is not in scope when typing the parents of those, and we avoid the cycle. Adds a test case to show the essense of the promiscious mutual imports that triggers this.
* | | | Merge pull request #1675 from retronym/ticket/6667-2Adriaan Moors2012-12-104-0/+61
|\ \ \ \ | |_|_|/ |/| | | SI-6667 Abort after any ambiguous in-scope implicit
| * | | SI-6667 Abort after any ambiguous in-scope implicitJason Zaugg2012-11-264-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than continuing on to a search of implicits of the expected type. Previously, the companion implicits were searched if the the caller was running the implicit search in silent mode, for example if searching for an implicit parameter in an application which has an expected type. After this commit, the behaviour is consistent, regardless on silent/non-silent typing.
* | | | Merge pull request #1668 from scalamacros/topic/pre-typemacrosAdriaan Moors2012-12-0710-28/+13
|\ \ \ \ | | | | | | | | | | refactors handling of parent types
| * | | | refactors handling of parent typesEugene Burmako2012-12-0610-28/+13
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment parser does too much w.r.t handling of parent types. It checks whether a parent can have value arguments or not and more importantly, it synthesizes constructors and super calls. This approach is fundamentally incompatible with upcoming type macros. Take for example the following two snippets of code: `class C extends A(2)` `class D extends A(2) with B(3)` In the first snippet, `A` might be a type macro, therefore the super call `A.super(2)` eagerly emitted by the parser might be meaningless. In the second snippet parser will report an error despite that `B` might be a type macro which expands into a trait. Unfortunately we cannot simply augment the parser with the `isTypeMacro` check. This is because to find out whether an identifier refers to a type macro, one needs to perform a typecheck, which the parser cannot do. Therefore we need a deep change in how parent types and constructors are processed by the compiler, which is implemented in this commit.
* / | | SI-6696 removes "helper" tree factory methodsEugene Burmako2012-12-061-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | As experience shows, these methods can easily be a source of confusion for the newcomers: https://issues.scala-lang.org/browse/SI-6696. I'm only leaving the TypeTree(tp) factory, since the facility to set underlying types for type trees is not exposed in the public API, as it's inherently mutable.
* | | Merge pull request #1682 from paulp/assert-about-qualifierPaul Phillips2012-12-031-2/+2
|\ \ \ | |_|/ |/| | Asserts about Tree qualifiers.
| * | Asserts about Tree qualifiers.Paul Phillips2012-11-291-2/+2
| | | | | | | | | | | | | | | Encoding recent revelations about certain tree invariants in the form of asserts.
* | | neg test addedmartende2012-11-276-0/+22
|/ /
* | Merge pull request #1663 from paulp/merge-2.10.wip-xAdriaan Moors2012-11-251-2/+8
|\ \ | | | | | | Merge 2.10.0-wip into 2.10.x.
| * \ Merge remote-tracking branch 'origin/2.10.0-wip' into merge-2.10.wip-xPaul Phillips2012-11-231-2/+8
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Jason Zaugg (8) and others # Via Adriaan Moors (6) and Josh Suereth (5) * origin/2.10.0-wip: Removing controversial `either` method from Futures API. SI-6624 set info of case pattern binder to help find case field accessors Fixes SI-6628, Revert "Fix for view isEmpty." SI-6661 - Remove obsolete implicit parameter of scala.concurrent.promise method Fixes SI-6559 - StringContext not using passed in escape function. SI-6648 copyAttrs must preserve TypeTree#wasEmpty Fix raw string interpolator: string parts which were after the first argument were still escaped Update comment. SI-6646 `ident` or Ident is always new binding. SI-6440 Address regressions around MissingRequirementError Refine the message and triggering of MissingRequirementError. SI-6640 Better reporting of deficient classpaths. SI-6644 Account for varargs in extmethod forwarder SI-6646 Fix regression in for desugaring. Update tools/epfl-publish
| | * SI-6440 Address regressions around MissingRequirementErrorJason Zaugg2012-11-131-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Go back to using globalError to report when a stub's info is referenced, and only throw the MissingRequirementError when compilation really must abort due to having a StubTermSymbol in a place where a StubClassSymbol would have been a better choice. This situation arises when an entire package is missing from the classpath, as was the case in the reported bug. Adds `StoreReporterDirectTest`, which buffers messages issued during compilation for more structured interrogation. Use this in two test for manifests -- these tests were using a crude means of grepping compiler console output to focus on the relevant output, but this approach was insufficient with the new multi-line error message emitted as part of this change. Also used that base test class to add two new tests: one for the reported error (package missing), and another for a simpler error (class missing). The latter test shows how stub symbols allow code to compile if it doesn't the subset of signatures in some type that refer to a missing class. Gave the INFO/WARNING/ERROR members of Reporter sensible toString implementations; they inherit from Enumeration#Value in an unusual manner (why?) that means the built in toString of Enumeration printed `Severity@0`.
* | | Merge pull request #1647 from adriaanm/backport-1626-2.10.xAdriaan Moors2012-11-252-0/+10
|\ \ \ | |/ / |/| | Fix for SI-6357, cycle with value classes.
| * | Fix for SI-6357, cycle with value classes.Paul Phillips2012-11-192-0/+10
| | | | | | | | | | | | Don't force the owner info.
* | | SI-6663: don't ignore type parameter on selectDynamic invocationJan Niehusmann2012-11-162-0/+25
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix mkInvoke to handle selectDynamic calls of the form new C.foo[T].xyz or new C.foo[T].xyz :U (where C extends Dynamic) Without this patch, the type parameter was silently ignored, and possibly inferred to a different. This patch fixes mkInvoke to handle these cases, where ctxTree has the form Select(TypeApply(fun, targs), nme) or Typed(...)
* | Merge pull request #1585 from retronym/ticket/6539-2Eugene Burmako2012-11-143-0/+26
|\ \ | | | | | | SI-6539 Annotation for methods unfit for post-typer ASTs
| * | Refine @compileTimeOnlyJason Zaugg2012-11-083-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't default the message, and show it exclusively. - Fix cut-and-pasto in the @since tag - Be tolerant if the annotaion class is missing, as seems to have been the case compiling the continuations plugin. - s/\t/ / in the test file to show the errors are positioned correctly. - Use defensive getOrElse
| * | SI-6539 Annotation for methods unfit for post-typer ASTsJason Zaugg2012-11-063-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | Motivated by the `.value` method in the SBT task-syntax branch, which should only be called within the context of the argument to a setting initialization macro. The facility is akin to a fatal deprecation.
* | | better error when typetagging local classesEugene Burmako2012-11-121-1/+1
|/ / | | | | | | Inspired by https://issues.scala-lang.org/browse/SI-6649
* | Merge branch '2.10.0-wip' into merge-2.10.0Josh Suereth2012-11-053-0/+28
|\|
| * Modification to SI-6534 patch.Paul Phillips2012-10-302-1/+7
| | | | | | | | | | | | Only exclude hashCode and equals from being overridden in value classes, not other synthetics which may turn up such as case class methods.