summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* 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 #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.
| * New take on SI-6534, value classes.Paul Phillips2012-10-243-0/+22
| | | | | | | | | | Don't prohibit equals and hashCode in universal traits; instead, always override them in value classes.
* | Fix for SI-6597, implicit case class crasher.Paul Phillips2012-10-312-0/+9
| | | | | | | | | | | | | | It seems to me like every call to scope.lookup in the compiler is a latent bug. If a symbol is overloaded, you get one at random. (See the FIXME comment in f5c336d5660 for more on this.)
* | Merge remote-tracking branch 'origin/2.10.0-wip' into merge-2.10.0-wipPaul Phillips2012-10-314-3/+65
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Jason Zaugg (5) and others # Via Josh Suereth (5) and others * origin/2.10.0-wip: Use Typed rather than .setType Wider use and a new variant of typedPos. SI-6575 Plug inference leak of AbstractPartialFun Disabled generation of _1, _2, etc. methods. SI-6526 Additional test case. Fix SI-6552, regression with self types. avoid single-art assert where harmful in duration-tck Fix for SI-6537, inaccurate unchecked warning. SI-6526 Tail call elimination should descend deeper. Changes Tree and Type members from vals to defs. Fixes SI-6170: issue with dragging scaladoc splitter over central iframe
| * Merge pull request #1507 from retronym/ticket/6526Josh Suereth2012-10-242-0/+57
| |\ | | | | | | SI-6526 Tail call elimination should descend deeper.
| | * SI-6526 Additional test case.Jason Zaugg2012-10-222-1/+9
| | |
| | * SI-6526 Tail call elimination should descend deeper.Jason Zaugg2012-10-172-0/+49
| | | | | | | | | | | | | | | It wasn't traversing into Select nodes nor into the receiver of a tail call.
| * | Fix for SI-6537, inaccurate unchecked warning.Paul Phillips2012-10-182-3/+8
| |/ | | | | | | | | | | | | | | I found a more direct expression of the unchecked logic, which should be much easier for others to verify. But the bug being fixed here is that the unchecked checking happens too early, and the sealed children of a symbol are not yet visible if it is being simultaneously compiled.
* / Closes SI-6358. Move accessor generation for lazy vals to typers.Hubert Plociniczak2012-10-182-9/+4
|/ | | | | | | | | | | | | Until now lazy accessors were handled somehow special because their symbol was created in typers but the corresponding tree was only added in Refchecks. This irregularity caused serious problems for value classes. Also it now looks just better when lazy value is treated in a similar way as other fields. I needed to adapt reifier so that it handles the new implementation correctly. Previously it had to recreate lazy val only by removing defdef and renaming. Now we basically need to recreate lazy val from scratch. There is one minor change to cps plugin but that is still fine because lazy vals were never really part of the transformation. Some range positions needed to be fixed manually. We could do it at the creation time but that would require a lot more "if (symbol.isLazy)" conditions for MethodSyntheis and Symbol/Tree creation and would just unnecessary complicate api. If someone has a better idea, please speak up. Range positions changes were necessary because previously accessors were created at refchecks and they weren't checked by validator (even though they were wrong). This commit removes lazy val implementation restriction introduced for 2.10.0. (cherry-picked from 981424b)
* SI-6483 Prohibit super[T] references in value classes.Jason Zaugg2012-10-072-0/+33
| | | | This seems the safest course of action for 2.10.0.
* Merge pull request #1455 from scalamacros/topic/manifestsJosh Suereth2012-10-052-38/+2
|\ | | | | undeprecates manifests for 2.10.0
| * undeprecates manifests for 2.10.0Eugene Burmako2012-10-032-38/+2
| | | | | | | | | | | | | | | | Since scala-reflect.jar is going to be declared experimental for 2.10.0, it doesn't make sense to deprecate manifests in favor of type tags. Class manifests, however, ARE deprecated for class tags, because class tags don't require scala-reflect.jar and are generated independently of type tags.
* | Merge pull request #1451 from gkossakowski/SI-6451Grzegorz Kossakowski2012-10-042-64/+64
|\ \ | |/ |/| SI-6451: Rename classes in `unchecked-abstract.scala` test.
| * SI-6451: Rename classes in `unchecked-abstract.scala` test.Grzegorz Kossakowski2012-10-032-64/+64
| | | | | | | | | | | | | | | | | | | | As reported Miguel, `Con` is problematic name of a class on Windows and makes this test to fail. Renamed classes to something else which hopefully make Windows build happy again. Closes SI-6451. Review by @magarciaEPFL or @paulp.
* | Merge pull request #1443 from gkossakowski/anyval-restrictionsGrzegorz Kossakowski2012-10-038-21/+67
|\ \ | | | | | | AnyVal/value classes restrictions
| * | Put more implementation restrictions on value classes.Grzegorz Kossakowski2012-10-034-4/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nested objects, classes and lazy vals are disallowed at any nesting level in value classes; e.g. lazy vals local to a method defined in a value class. There are still allowed in universal traits. This is a temporary, implementation restriction that is planned to be addressed in future releases of Scala. Error messages has been updated to communicate that intent. Moved tests for SI-5582 and SI-6408 to pending folder. They have to stay there until implementation restrictions are addressed. Closes SI-6408 and SI-6432. Review by @odersky, @harrah and @adriaanm.
| * | Revised restrictions for value classes and unversal traitsMartin Odersky2012-10-035-19/+12
| |/ | | | | | | | | | | | | | | | | and brought compiler in line with them. One thing we can accept IMO are nested classes (nested objects are still a problem). In fact, it makes no sense to exclude nested classes from value classes but not from universal traits. A class nested in universal trait will becomes a class nested in a value class by inheritance. Note that the reflection library already contains a universal trait with a nested class (IndexedSeqLike), so we should accept them if we can.
* | Merge pull request #1446 from retronym/ticket/6436-2Grzegorz Kossakowski2012-10-034-0/+38
|\ \ | |/ |/| SI-6436 Handle ambiguous string processors
| * SI-6436 Handle ambiguous string processorsJason Zaugg2012-10-024-0/+38
| | | | | | | | | | | | | | | | Before, we got in an inifinite loop by chasing the error typed result of adaptToMemberWithArgs. One point of befuddlement remains: why did t6436 and t6436b behave differently before this change?
* | Revert "SI-4881 infer variance from formals, then result"Paul Phillips2012-09-291-1/+4
|/ | | | This reverts commit 5c5e8d4dcd151a6e2bf9e7c259c618b9b4eff00f.
* Added logic and tests for unchecked refinements.Paul Phillips2012-09-273-0/+41
|
* Nailed down the "impossible match" logic.Paul Phillips2012-09-2712-6/+185
| | | | | | | | | | | | | | | | | | I will again defer to a comment. /** Given classes A and B, can it be shown that nothing which is * an A will ever be a subclass of something which is a B? This * entails not only showing that !(A isSubClass B) but that the * same is true of all their subclasses. Restated for symmetry: * the same value cannot be a member of both A and B. * * 1) A must not be a subclass of B, nor B of A (the trivial check) * 2) One of A or B must be completely knowable (see isKnowable) * 3) Assuming A is knowable, the proposition is true if * !(A' isSubClass B) for all A', where A' is a subclass of A. * * Due to symmetry, the last condition applies as well in reverse. */
* Restored warning for impossible type tests.Paul Phillips2012-09-261-6/+6
| | | | | | | | | | | I had this in before, then removed it since it is sometimes redundant with an error message later issued by the pattern matcher (e.g. scrutinee is incompatible with pattern type.) However it also catches a lot of cases which are not errors, so I think the modest redundancy is tolerable for now. I also enhanced the logic for recognizing impossible type tests, taking sealedness into account.
* Yet more tests for unchecked warnings.Paul Phillips2012-09-262-1/+75
|
* Additional new tests for unchecked warnings.Paul Phillips2012-09-256-0/+85
|
* Improvements to unchecked warnings.Paul Phillips2012-09-255-28/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes SI-6275, SI-5762. The comment says is better than I can. /** On pattern matcher checkability: * * Consider a pattern match of this form: (x: X) match { case _: P => } * * There are four possibilities to consider: * [P1] X will always conform to P * [P2] x will never conform to P * [P3] X <: P if some runtime test is true * [P4] X cannot be checked against P * * The first two cases correspond to those when there is enough static * information to say X <: P or that !(X <: P) for all X and P. * The fourth case includes unknown abstract types or structural * refinements appearing within a pattern. * * The third case is the interesting one. We designate another type, XR, * which is essentially the intersection of X and |P|, where |P| is * the erasure of P. If XR <: P, then no warning is emitted. * * Examples of how this info is put to use: * sealed trait A[T] ; class B[T] extends A[T] * def f(x: B[Int]) = x match { case _: A[Int] if true => } * def g(x: A[Int]) = x match { case _: B[Int] => } * * `f` requires no warning because X=B[Int], P=A[Int], and B[Int] <:< A[Int]. * `g` requires no warning because X=A[Int], P=B[Int], XR=B[Int], and B[Int] <:< B[Int]. * XR=B[Int] because a value of type A[Int] which is tested to be a B can * only be a B[Int], due to the definition of B (B[T] extends A[T].) * * This is something like asSeenFrom, only rather than asking what a type looks * like from the point of view of one of its base classes, we ask what it looks * like from the point of view of one of its subclasses. */
* Merge remote-tracking branch 'paulp/topic/gitattributes' into 2.10.xPaul Phillips2012-09-2073-605/+605
|\
| * Normalized line endings.Paul Phillips2012-09-2073-605/+605
| | | | | | | | | | | | This brings all the files into line with the .gitattributes settings, which should henceforth be automatically maintained by git.
* | Merge pull request #1325 from odersky/ticket/6337Paul Phillips2012-09-203-8/+36
|\ \ | | | | | | Fixes SI-6337 by disallowing nested value classes.
| * | Fixes SI-6337 by disallowing nested value classes.Martin Odersky2012-09-173-8/+36
| | | | | | | | | | | | It seems for the moment too hard to allow this, and the functionality to have value classes wrap other value classes does not seem essential.
* | | Merge pull request #1356 from paulp/pullreq-1342Josh Suereth2012-09-205-13/+17
|\ \ \ | | | | | | | | Pullreq 1342
| * | | Error message improvement for SI-6336.Paul Phillips2012-09-194-13/+13
| | | | | | | | | | | | | | | | | | | | Position error messages about structural type members at the problematic parameter or type.
| * | | SI-6336 Now also catches return typesMartin Odersky2012-09-182-1/+5
| | | | | | | | | | | | | | | | | | | | As Mark's comments on SI-6336 shows, we also need to disallow value classes as return types of structural types.
* | | | Merge pull request #1339 from rkuhn/wip-6389-finite-duration-multJosh Suereth2012-09-202-7/+7
|\ \ \ \ | |_|_|/ |/| | | enable integer multiplication/divison on FiniteDuration, see SI-6389
| * | | move Duration (incl. DSL) into scala.concurrent.duration packageRoland2012-09-192-7/+7
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | so that the full package can be imported naturally: import scala.concurrent.duration._ will give you all the types (Duration, FiniteDuration, Deadline) and the DSL for constructing these.