summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1382 from paulp/topic/tpe_starPaul Phillips2012-10-073-42/+0
|\ | | | | Defanged dummy type arguments.
| * Removed obsolete migration test.Paul Phillips2012-10-023-42/+0
| | | | | | | | Arrays are not Seqs: a fact known by all and sundry.
* | Incorporated pull request feedback.Paul Phillips2012-10-052-18/+58
| | | | | | | | | | | | And fixed the test I broke at the last minute. Reworked tupling logic to make it harder to break. Expanded test coverage.
* | Merge pull request #1447 from paulp/spuriousPaul Phillips2012-10-044-8/+20
|\ \ | | | | | | Spurious warning elimination.
| * | Fix for spurious warning.Paul Phillips2012-10-043-4/+19
| | | | | | | | | | | | | | | | | | Eliminates spurious "catch block may intercept non-local return" seen in recent builds of master. Unified some catch logic in TreeInfo, and removed some which never worked.
| * | Fix for rangepos crasher.Paul Phillips2012-10-041-4/+1
| | | | | | | | | | | | | | | wrapClassTagUnapply was generating an unpositioned tree which would crash under -Yrangepos. See SI-6338.
* | | Merge pull request #1369 from som-snytt/issue/6406-regextractPaul Phillips2012-10-043-0/+12
|\ \ \ | |/ / |/| | Regex.unapplySeq should not take Any (Fixes SI-6406)
| * | Regex.unapplySeq should not take Any (Fixes SI-6406)Som Snytt2012-09-203-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates unapplySeq(Any) and adds overloaded unapplySeq(CharSequence) and unapplySeq(Match), with the putative advantage that you can't try to extract the unextractable. Regex is massaged so that the underlying Pattern is primary, rather than the String-valued expression. Regex and its unanchored companion (I almost wrote unmoored) share a Pattern object, so that unapplySeq(Match) can easily test whether the Match was generated by this Regex; in that case, the match result is used immediately, instead of reapplying the regex to the matched string. The documentation is massaged to reflect unanchored and also to align with the underlying terminology, e.g., "subgroup" really just means "group."
* | | Merge remote-tracking branch 'scala/2.10.x'Grzegorz Kossakowski2012-10-031-1/+4
|\ \ \ | |_|/ |/| | | | | | | | | | | Conflicts: build.number src/reflect/scala/reflect/internal/Types.scala
| * | Revert "SI-4881 infer variance from formals, then result"Paul Phillips2012-09-291-1/+4
| | | | | | | | | | | | This reverts commit 5c5e8d4dcd151a6e2bf9e7c259c618b9b4eff00f.
* | | Merge pull request #1437 from paulp/typevar-suspensionGrzegorz Kossakowski2012-10-024-9/+26
|\ \ \ | | | | | | | | Typevar suspension
| * | | Fix for TypeVar instantiation.Paul Phillips2012-10-014-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an effort to reduce the enormous amount of duplication which now exists among methods which attempt to deduce something about the relationship between two types, a sampling (and only a sampling - this might not even be half of them) given here: def isAsSpecific(ftpe1: Type, ftpe2: Type): Boolean def isCompatibleByName(tp: Type, pt: Type): Boolean def isConservativelyCompatible(tp: Type, pt: Type): Boolean def isConsistent(tp1: Type, tp2: Type): Boolean def isDifferentType(tp1: Type, tp2: Type): Boolean def isDifferentTypeConstructor(tp1: Type, tp2: Type): Boolean def isDistinguishableFrom(t1: Type, t2: Type): Boolean def isNeverSubType(tp1: Type, tp2: Type): Boolean def isNumericSubType(tp1: Type, tp2: Type): Boolean def isPlausiblyCompatible(tp: Type, pt: Type): Boolean def isPopulated(tp1: Type, tp2: Type): Boolean def isSameType(tp1: Type, tp2: Type): Boolean def isSameType2(tp1: Type, tp2: Type): Boolean def isSubType(tp1: Type, tp2: Type): Boolean def isWeakSubType(tp1: Type, tp2: Type): Boolean def isWeaklyCompatible(tp: Type, pt: Type): Boolean def matches(tpe1: Type, tpe2: Type): Boolean def overlaps(tp1: Type, tp2: Type): Boolean def typesConform(tp: Type, pt: Type): Boolean I began pulling a thread left by moors in isPopulated: need to investgate why this can't be made symmetric -- neg/gadts1 fails, and run/existials also. Followed that to this code in TypeVar: val newInst = wildcardToTypeVarMap(tp) (constr isWithinBounds newInst) && { setInst(tp); true } -------^ That was the obstacle to symmetry, because it creates a cycle in e.g. run/existentials. Kept pulling the string, came back to my own comment of long ago: !!! Is it somehow guaranteed that this will not break under nesting? In general one has to save and restore the contents of the field... Decided that uncertainty could no longer be tolerated. Unless it can be proven somehow that there will never be crosstalk among the save/suspension points, we should do it this way even if nothing demands it yet. What's in this commit: - Made isPopulated symmetric. - Made setInst resistant to TypeVar cycles. - Fixed above mentioned bug in registerTypeEquality. - Added some rigor to the suspension/unsuspension of TypeVars so it will not break under nesting. - Recovered pos/t0851.scala from its deletion.
* | | | Fix for SI-5353, imperfect error message.Paul Phillips2012-09-294-2/+9
|/ / / | | | | | | | | | The fix of course is a perfect error message.
* | | Merge branch '2.10.x' into 210-mergePaul Phillips2012-09-2825-29/+472
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.10.x: (37 commits) Added logic and tests for unchecked refinements. Moved isNonRefinementClassType somewhere logical. Moved two tests to less breaky locations. Nailed down the "impossible match" logic. Finish docs for string interpolation. moves Context.ParseError outside the cake revives macros.Infrastructure moves Context.runtimeUniverse to TreeBuild.mkRuntimeUniverseRef a more precise type for Context.mirror gets rid of macros.Infrastructure simplifies Context.Run and Context.CompilationUnit exposes Position.source as SourceFile removes extraneous stuff from macros.Infrastructure merges macros.CapturedVariables into macros.Universe merges macros.Exprs and macros.TypeTags into Context removes front ends from scala-reflect.jar PositionApi => Position hides BuildUtils from Scaladoc MirrorOf => Mirror docs.pre-lib now checks for mods in reflect ... Conflicts: test/files/neg/t4302.check test/files/neg/unchecked.check test/files/neg/unchecked2.check
| * | 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 branch '2.10.x'Paul Phillips2012-09-2087-421/+534
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.10.x: (36 commits) Normalized line endings. New .gitattributes file. Disabled failing build manager tests. New test case for SI-6337 New test case for closing SI-6385 Value classes: eliminated half-boxing Cleanup of OverridingPairs Fixes SI-6260 Use faster download URL now that artifactory is fixed. don't try to create tags w/o scala-reflect.jar some small remaining fixes SI-5943 toolboxes now autoimport Predef and scala Fix for loud test. SI-6363 deploys the updated starr SI-6363 removes scala.reflect.base SI-6392 wraps non-terms before typecheck/eval SI-6394 fixes macros.Context.enclosingClass Error message improvement for SI-6336. Adjustments to scala.concurrent.duration. prepping for the refactoring ... Conflicts: src/actors-migration/scala/actors/Pattern.scala src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/collection/immutable/Vector.scala test/files/jvm/actmig-PinS_1.scala test/files/jvm/actmig-PinS_2.scala test/files/jvm/actmig-PinS_3.scala test/files/jvm/actmig-public-methods_1.scala
| * | 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.
| * | | | New test case for closing SI-6385Martin Odersky2012-09-202-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | The fixes for SI-6260 + elimination of hlaf-boxing also solve SI-6385
| * | | | Value classes: eliminated half-boxingMartin Odersky2012-09-202-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now apply erasure of value classes everywhere. previously, erasure was disabled in the value class itself. This led to irregegularities and bugs. See test run/valueclasses-pavlov.scala for something that led to a ClassCastException before.
| * | | | Fixes SI-6260Martin Odersky2012-09-202-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guards against bridge methods that clash with other methods. Two tests: The neg test is the original ticket. The run test tweaks things slightly so that the generated bridge method does not clash, and tests that the necessary unboxings are indeed performed at runtime.
| * | | | Merge pull request #1354 from scalamacros/ticket/6363Eugene Burmako2012-09-192-3/+4
| |\ \ \ \ | | | | | | | | | | | | merges scala.reflect.base into scala.reflect.api
| | * | | | SI-6363 removes scala.reflect.baseEugene Burmako2012-09-192-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the experience has shown, there's no need for a separate layer of reflection in scala-library.jar. Therefore I'm putting an end to it.
* | | | | | Merge branch '2.10.x' into masterPaul Phillips2012-09-1932-112/+240
|\| | | | | | |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.10.x: (51 commits) improved/fixed reflection docs based on comments Fixes SI-6354: improved error messages for Dynamic signature mismatches. Add RedBlackTree tests for take/drop/slice. Retain Ordering in drop/take/slice signatures. test case closes SI-5770 clarify caveats of App trait Remove `@static` annotation from the library. New starr that does not depend on `@static`. improved reflection documentation pull request feedback SI-5692 better error message SI-5942 toolboxes now reset front ends SI-6287 fixes synthetic symbol clashes in toolbox Revert "Implement @static annotation on singleton object fields." Revert "WIP add private/lazy checks and a few tests." Revert "Fixes SI-6189." Revert "Fixes SI-6236." Revert "Fix SI-4581." Revert "Fix SI-6294." refactors java reflection tests ... Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala src/partest/scala/tools/partest/package.scala src/reflect/scala/reflect/internal/Trees.scala
| * | | | Fixes SI-6354: improved error messages for Dynamic signature mismatches.amin2012-09-193-2/+74
| |/ / / | | | | | | | | | | | | | | | | | | | | If an error occurs afer a Dynamic rewriting, augment the error message with the rewritten tree and a hint to check the Dynamic method signature.
| * | | Merge pull request #1340 from gkossakowski/revert-static-annotationGrzegorz Kossakowski2012-09-185-104/+0
| |\ \ \ | | |_|/ | |/| | Revert `@static` annotation
| | * | Revert "Implement @static annotation on singleton object fields."Grzegorz Kossakowski2012-09-172-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 892ee3df93a10ffe24fb11b37ad7c3a9cb93d5de with exception of keeping `@static` annotation in the library so we can deploy a new starr that does not depend on it before removing it completely. Conflicts: src/compiler/scala/tools/nsc/backend/icode/GenICode.scala src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala src/compiler/scala/tools/nsc/transform/CleanUp.scala
| | * | Revert "WIP add private/lazy checks and a few tests."Grzegorz Kossakowski2012-09-172-24/+1
| | | | | | | | | | | | | | | | This reverts commit 227239018b38ab7218ee6b30493c9c8e1836c8c9.
| | * | Revert "Fixes SI-6189."Grzegorz Kossakowski2012-09-171-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5a8dfad583b825158cf0abdae5d73a4a7f8cd997. Conflicts: src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
| | * | Revert "Fix SI-4581."Grzegorz Kossakowski2012-09-174-33/+1
| | |/ | | | | | | | | | This reverts commit 373f22a2022519ab894c1ea77460e6460d7c2ee4.
| * / SI-5692 better error messageEugene Burmako2012-09-188-0/+28
| |/ | | | | | | | | | | Doesn't fix the underlying issue with macros and type inference, but at least now the error message says exactly what needs to be done to make the error go away.
| * SI-6336 Disallows value types in structuralal refinementsMartin Odersky2012-09-162-0/+15
| | | | | | | | | | Structural refinements already have a number of restrictions, e.g. cannot refer to type parameters of enclosing classes. We need to disallow value classes as well.
| * Merge pull request #1302 from scalamacros/topic/reflectionEugene Burmako2012-09-146-6/+6
| |\ | | | | | | cleaning up reflection
| | * SI-6342 cleans up toolbox APIEugene Burmako2012-09-156-6/+6
| | | | | | | | | | | | | | | | | | 1) parseExpr => parse 2) runExpr => eval 3) Introduces compile(Tree): () => Any, since it has frequent uses
| * | Merge pull request #1290 from retronym/ticket/no-implicit-to-anyrefPaul Phillips2012-09-142-0/+57
| |\ \ | | | | | | | | A little cleanup along the Any to AnyRef trail.
| | * | A little cleanup along the Any to AnyRef trail.Jason Zaugg2012-09-112-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to 35316be and d3f879a. - Remove obsolete comments and replace them with a test. - Don't emit error addendum unless we know we're dealing with a value class.
| * | | Merge pull request #1299 from namin/si-6245Paul Phillips2012-09-146-0/+60
| |\ \ \ | | |_|/ | |/| | Fix for SI-6245 with workaround for SI-2296.
| | * | Fix for SI-6245 with workaround for SI-2296.amin2012-09-136-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | protected/super accessor issue: Don't subvert the creation of the standard protected accessor with the java interop accessor. For SI-2296, the compiler emits an error instead of causing an illegal access error at runtime.