summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
...
| | * 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)
* | Merge pull request #1518 from retronym/ticket/2968Josh Suereth2012-10-234-0/+47
|\ \ | | | | | | SI-2968 Fix brace healing for `^case (class|object) {`
| * | SI-2968 Fix brace healing for `^case (class|object) {`Jason Zaugg2012-10-224-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The scanner coalesces the pair of tokens into CASEOBJECT or CASECLASS, but fails to set `offset` back to the start of `case`. Brace healing is then unable to correctly guess the location of the missing brace. This commit resets `offset` and `lastOffset`, as though caseobject were a single keyword. Only the former was neccessary to fix this bug; I haven't found a test that shows the need for the latter.
* | | Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2012-10-192-0/+33
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: (52 commits) JavaUniverse Moved @contentDiagram in Symbols Adds lots of new documentation for TypeTags, Mirrors, Universes and more runtime.JavaUniverse - put ungrouped members at the top Forgotten annotation in Annotations Diagram tweaking Grouping for reflection and macros fixes a typo scala.reflect.api.Symbols documentation Symbols docs cleanup, mostly moved to guide scala.reflect.api.Position documentation scala.reflect.api.StandardNames documentation scala.reflect.api.Constants documentation removed docs for internal TypeCreator and TreeCreator simplified reflection docs for trees Rearranged some reflection docs, moving things to the guide reflection docs improvements and moves to doc page docs for reflection and macros SI-6509 Correct @template owners SI-6155 Scaladoc @template diagrms ... Conflicts: src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/api/Trees.scala test/scaladoc/run/links.scala
| * 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.
* | Warn about more misplaced expressions.Paul Phillips2012-10-132-2/+29
| | | | | | | | | | An identifier being used in statement position is not likely what was meant when it is a non-lazy getter.
* | Merge pull request #1422 from paulp/typer-cyclesPaul Phillips2012-10-105-1/+12
|\ \ | | | | | | Typer cycles
| * | Fix for SI-4744, another variety of cycle.Paul Phillips2012-10-095-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I threw this in with the previous commit behind -Ybreak-cycles, but this one is much less sketchy. Explanation: have to handle f-bounds more deftly. Namers forces lower bounds to prevent recursion in that direction, but a light touch is required to handle these two situations differently: // This is a cyclic type parameter - an error is correct class A[T <: Comparable[_ <: T]] // This is not cyclic - it flips the arrow class B[T <: Comparable[_ >: T]] Long have I been haunted by the knowledge that you can write class B in java, but not in scala: public class B<T extends Comparable<? super T>> {} It's over! We've achieved parity with java.
* | | Closes SI-6358. Move accessor generation for lazy vals to typers.Hubert Plociniczak2012-10-092-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.
* | Merge remote-tracking branch 'origin/2.10.0-wip' into merge-2.10Paul Phillips2012-10-0716-123/+171
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.0-wip: MethodSymbol.params => MethodSymbol.paramss SI-6471 Update jquery from 1.4.2 to 1.8.2 undeprecates manifests for 2.10.0 SI-6451: Rename classes in `unchecked-abstract.scala` test. Put more implementation restrictions on value classes. Fixed problem in SI-6408 Revised restrictions for value classes and unversal traits SI-6436 Handle ambiguous string processors fixes a bug in a weak cache in runtime reflection Conflicts: test/files/neg/classmanifests_new_deprecations.check test/files/neg/unchecked-abstract.check
| * 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?
* | | 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.