summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* New starr to support new fundamental laws of reality.Paul Phillips2012-03-142-4/+2
| | | | | | | | | | And grueling recovery from branch drift. Merges a portion (and only a portion) of topic/inline into master. The major changes which come with this merge are: AnyVal is unsealed, can be extended directly. ScalaObject is no longer with us.
* Merge branch 'master' into merge-inlinePaul Phillips2012-03-1475-17/+975
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: lib/scala-compiler.jar.desired.sha1 lib/scala-library-src.jar.desired.sha1 lib/scala-library.jar.desired.sha1 src/compiler/scala/reflect/internal/Definitions.scala src/compiler/scala/reflect/internal/Importers.scala src/compiler/scala/reflect/internal/Symbols.scala src/compiler/scala/reflect/internal/Trees.scala src/compiler/scala/reflect/internal/Types.scala src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/compiler/scala/tools/nsc/transform/LiftCode.scala src/compiler/scala/tools/nsc/transform/UnCurry.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala test/files/run/programmatic-main.check test/files/speclib/instrumented.jar.desired.sha1
| *-. Merge remote-tracking branches 'adriaanm/ticket/5189' and ↵Paul Phillips2012-03-114-0/+81
| |\ \ | | | | | | | | | | | | 'jsuereth/better-starr-flow' into develop
| | * | SI-5189 fixed: safe type infer for constr patternAdriaan Moors2012-03-092-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | several fixes to the standard library due to - the safer type checker this fix gives us (thus, some casts had to be inserted) - SI-5548 - type inference gets a bit more complicated, it needs help (chainl1 in combinator.Parsers) To deal with the type slack between actual (run-time) types and statically known types, for each abstract type T, reflect its variance as a skolem that is upper-bounded by T (covariant position), or lower-bounded by T (contravariant). Consider the following example: class AbsWrapperCov[+A] case class Wrapper[B](x: Wrapped[B]) extends AbsWrapperCov[B] def unwrap[T](x: AbsWrapperCov[T]): Wrapped[T] = x match { case Wrapper(wrapped) => // Wrapper's type parameter must not be assumed to be equal to T, // it's *upper-bounded* by it wrapped // : Wrapped[_ <: T] } this method should type check if and only if Wrapped is covariant in its type parameter before inferring Wrapper's type parameter B from x's type AbsWrapperCov[T], we must take into account that x's actual type is: AbsWrapperCov[Tactual] forSome {type Tactual <: T} since AbsWrapperCov is covariant in A -- in other words, we must not assume we know T exactly, all we know is its upper bound since method application is the only way to generate this slack between run-time and compile-time types (TODO: right!?), we can simply replace skolems that represent method type parameters as seen from the method's body by other skolems that are (upper/lower)-bounded by that type-parameter skolem (depending on the variance position of the skolem in the statically assumed type of the scrutinee, pt) this type slack is introduced by adaptConstrPattern: before it calls inferConstructorInstance, it creates a new context that holds the new existential skolems the context created by adaptConstrPattern must not be a CaseDef, since that confuses instantiateTypeVar and the whole pushTypeBounds/restoreTypeBounds dance (CaseDef contexts remember the bounds of the type params that we clobbered during GADT typing) typedCase deskolemizes the existential skolems back to the method skolems, since they don't serve any further purpose (except confusing the old pattern matcher) typedCase is now better at finding that context (using nextEnclosing)
| | * | SI-5189 1/2: inferConstrInst uses correct varianceAdriaan Moors2012-03-092-0/+11
| | | | | | | | | | | | | | | | | | | | fixed concurrent.impl.Promise by making FState invariant (it would be unsound to make it covariant)
| * | | Fix for tailcall transform/recognition bugs.Paul Phillips2012-03-116-2/+35
| | |/ | |/| | | | | | | Closes SI-3275, SI-5455.
| * | Merge remote-tracking branch 'hubertp/issue/5554' into developPaul Phillips2012-03-072-0/+106
| |\ \
| | * | Closes #SI-5554Hubert Plociniczak2012-03-062-0/+106
| | | |
| * | | Merge remote-tracking branches 'adriaanm/ticket/5546' and ↵Paul Phillips2012-03-064-0/+197
| |\ \ \ | | |_|/ | |/| | | | | | 'hubertp/issue/5553' into develop
| | * | Closes #5553, review by dragosHubert Plociniczak2012-03-064-0/+197
| | |/
| * | Test for SI-5529.Paul Phillips2012-02-282-0/+25
| | |
| * | Don't print underlying type of modules.Paul Phillips2012-02-283-4/+4
| | | | | | | | | | | | Since there is no useful information in such a message.
| * | Fix for typing of objects in patterns.Paul Phillips2012-02-282-3/+3
| | | | | | | | | | | | | | | An object in a pattern should have type "Foo.type" just as objects not in patterns do. Closes SI-5406. Review by @moors.
| * | Improving error message.Paul Phillips2012-02-286-9/+9
| |/ | | | | | | | | Hacked filename into message to alleviate meaningless "_$1 defined twice" error condition. References SI-4893.
| * Merge remote-tracking branch 'adriaanm/ticket/errortests'Paul Phillips2012-02-236-1/+26
| |\
| | * test for DependentMethodTpeConversionToFunctionErrorAdriaan Moors2012-02-232-0/+9
| | |
| | * test for TooManyArgsPatternErrorAdriaan Moors2012-02-232-0/+9
| | |
| | * test for OverloadedUnapplyErrorAdriaan Moors2012-02-232-1/+8
| | |
| | |
| | \
| | \
| | \
| | \
| | \
| | \
| | \
| *-------. | Merge remote-tracking branches 'namin/add-test-for-finitary-error', ↵Paul Phillips2012-02-2310-0/+56
| |\ \ \ \ \| | | | | | | | | | | | | | | | | | | | | | 'namin/add-test-for-parent-inherited-twice-error', 'namin/add-test-for-constructor-prefix-error', 'namin/add-tests-for-qualifying-class-error', 'namin/add-test-for-abstraction-from-volatile-type-error' and 'axel22/issue/5293' into develop
| | | | | * | Add test for AbstractionFromVolatileTypeError.Nada Amin2012-02-232-0/+15
| | | | | |/
| | | | * / Add tests for QualifyingClassError.Nada Amin2012-02-234-0/+21
| | | | |/
| | | * / Add test for ConstructorPrefixError.Nada Amin2012-02-232-0/+11
| | | |/
| | * / Add test case for ParentInheritedTwiceError.Nada Amin2012-02-232-0/+9
| | |/
| * / Added test case for FinitaryError.Nada Amin2012-02-232-0/+7
| |/
| * One last nudge for elidable.Paul Phillips2012-02-223-36/+0
| | | | | | | | | | A method with return type Nothing elides into a call to ??? . It's the role ??? was born for.
| * Reworked and restored elidable.Paul Phillips2012-02-223-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | Found a better elidable implementation which is robust against other parts of the compiler doing their things. Calls to elidable methods are replaced with zero of the same type. Elidable methods themselves remain in place, but with their body replaced with a zero of the method return type. Thus is everything to be found where it is expected to be found, but nothing will be found where nothing ought to be found. Nothing of course will never be found.
| * Revert recent elidable commits.Paul Phillips2012-02-223-36/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On epfl jenkins, elidable.scala fails with: [partest] java.lang.VerifyError: (class: Test$, method: main signature: ([Ljava/lang/String;)V) Unable to pop operand off an empty stack [partest] [partest] at Test.main(elidable.scala) Strangely it is fine for me on OSX with either apple's jvm or openjdk. Since tests were not running for a while I don't know which of the recent elidable commits is responsible, so given present time demands all I can do is revert them all. Revert "Fix for SI-5215: scalac crash when @elidable used in trait" This reverts commit 5e52ce9a13f12ef159e25ac80c6be2803ec48950. Revert "Fix for SI-5215 part 2: generate return value when eliding method calls" This reverts commit 61c9b4f01d99a81e15391b270bd1b5a895f65ffd. Revert "Eliminating duplication in zero creation." This reverts commit fbb7865e137e83660257fdc79d19d29ff39c775b. Revert "Disallow eliding when Nothing is expected" This reverts commit f26a47c4e8bda2f6c689b4e9b0bb5c64ccf4c699.
| *-. Merge remote-tracking branches 'som-snytt/elide-nothing', ↵Paul Phillips2012-02-215-1/+56
| |\ \ | | | | | | | | | | | | 'szabolcsberecz/SI-5316' and 'szabolcsberecz/SI-5171' into develop
| | | * Test for SI-5316Szabolcs Berecz2012-02-212-1/+20
| | |/ | |/| | | | | | | Compiler NPE on 2.9.1 when implicit parameter not found
| | * Disallow eliding when Nothing is expectedSom Snytt2012-02-213-0/+36
| |/
| * A better error message for inheritance conflict.Paul Phillips2012-02-192-0/+11
| | | | | | | | | | | | And some tests for pending. Closes SI-5358.
| *-. Merge remote-tracking branches 'hubertp/issue/5452' and 'hubertp/issue/5493' ↵Paul Phillips2012-02-176-0/+53
| |\ \ | | | | | | | | | | | | into develop
| | | * Closes #5497.Hubert Plociniczak2012-02-184-0/+16
| | | | | | | | | | | | | | | | Chain contexts by sharing the error buffer, unless you explicitly create a silent context. Review by @odersky
| | * | Closes #5452.Hubert Plociniczak2012-02-172-0/+37
| | |/ | | | | | | | | | | | | | | | | | | | | | Instead of trying to track the fallback attempts we rely on the context state to inform us which fallback is the last one. setError cannot always be called in NoBestMethodAlternativeError because inferMethodAlternative relies on side-effects. Review by @paulp.
| * / Fixes miscellaneous macro bugsEugene Burmako2012-02-1714-0/+46
| |/
| * Merge branch 'develop'Paul Phillips2012-02-152-2/+2
| |\
| | *-. Merge remote-tracking branches 'scalamacros/pullrequest/preprocessreifees' ↵Paul Phillips2012-02-152-2/+2
| | |\ \ | | | | | | | | | | | | | | | and 'scalamacros/pullrequest/multilineinterpolation' into develop
| | | * | Disables typechecking that precedes reflective compilationEugene Burmako2012-02-142-2/+2
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously toolboxes used to typecheck their inputs before compiling. Actually, the initial demo by Martin first typechecked the reified tree, then ran it, which typechecked it again, and only then launched the reflective compiler. However, as observed in https://issues.scala-lang.org/browse/SI-5464 current implementation of typechecking is not always idempotent. That's why we cannot allow inputs of toolboxes to be typechecked, at least not until the aforementioned issue is closed. This is not only a convention but also a check inside compileExpr.
| * | | Revert "Fix for SI-5452."Paul Phillips2012-02-152-35/+0
| | | | | | | | | | | | | | | | This reverts commit 2b731911e97a281e324060099631e2374b2144ec.
| * | | Revert "Make fix for SI-5452 not break other things."Paul Phillips2012-02-151-3/+1
| |/ / | | | | | | | | | This reverts commit a725bf982c06e16c5d533ea6b2227b726db4f7e4.
| * | Merge remote-tracking branch 'paulp/objects-and-overrides'Paul Phillips2012-02-152-0/+225
| |\ \ | | |/ | |/|
| | * Fix for bad bug with accidental overrides.Paul Phillips2012-02-012-0/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | An object in a subclass would silently override an inherited method, then throw a CCE at runtime. I blamed this on matchesType and altered it accordingly. There's a pretty extensive test case which reflects my expectations. Review by @odersky please. Closes SI-5429.
| * | Make fix for SI-5452 not break other things.Paul Phillips2012-02-141-1/+3
| | | | | | | | | | | | If this looks hacky, that's because it is.
| * | Fix for SI-5452.Paul Phillips2012-02-132-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why is calling the error function not enough to register the error, why does "setError(tree)" have to be called as well? That was the cause of this particular stackoverflow. In ContextErrors I see lots of methods which call setError and lots more which do not, and frankly it's all pretty terrifying. There is zero documentation attached to setError. Maybe there's an explanation somewhere I'm not seeing. Review by @hubertp.
| * | reifyAnnotationsEugene Burmako2012-02-124-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Annotations are now supported by the reifier: * AnnotationInfos from symbols get transformed back into mods. * AnnotatedTypes are retained and are reified along with AnnotationInfos. Reification is no magic, and reification of annotations especially: * Annotations cannot refer to symbols defined inside the quasiquote. This restriction is due to the fact that we need to erase locally defined symbols before reifying to make subsequent reflective compilations succeed. However, while doing that, we also need to make sure that we don't make resulting ASTs non-compilable by removing essential information. This is tricky, and it more or less works for TypeTrees, but not for annotations that can contain arbitrary ASTs. For more details look into the comments to Reifiers.scala. * Classfile annotations that contain array arguments and are applied to types, i.e. the ones that generate AnnotatedTypes, cannot be reified. This is because of limitations of manifest infrastructure. Typechecking "Array(mirror.LiteralAnnotArg(...))" would require the compiler to produce a manifest for a path-dependent type, which cannot be done now. Review by @odersky.
| * | Another existential problem down.Paul Phillips2012-02-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a window of danger when multiple related elements are being typed where something which is conceptually one thing can slip into two things, and those two things can be incompatible with one another. Less mysteriously, c478eb770d fixed this: def f = { object Bob ; Bob } ; val g = f But, it did not fix this: def f = { case class Bob() ; Bob } ; val g = f See test case pos/existentials-harmful.scala for an "in the wild" code example fixed by this commit. The root of the problem was that the getter and the field would each independently derive the same existential type to describe Bob, but those existentials were not the same as one another. This has been the most elusive bug I have ever fixed. I want to cry when I think of how much time I've put into it over the past half decade or so. Unfortunately the way the repl works it is particularly good at eliciting those grotesque found/required error messages and so I was never able to let the thing go. There is still a cosmetic issue (from the last commit really) where compound types wind up with repeated parents. Closes SI-1195, SI-1201.
* | | Checkfile output update for AnyVal class.Paul Phillips2012-02-041-1/+4
| | | | | | | | | | | | And with that one, I believe all tests pass.
* | | Making AnyVal into a class instead of a trait.Paul Phillips2012-02-042-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- traits can extend Any, AnyRef, or AnyVal -- classes can extend AnyRef or AnyVal but not Any. This breaks reflection for the moment as it smuggles AnyVal so far downstream that it's reflecting its way into bytecode (or something) but the following test case goes five for six as anticipated. trait Foo1 extends Any trait Foo2 extends AnyVal trait Foo3 extends AnyRef class Bar1 extends Any // fail @inline class Bar2 extends AnyVal class Bar3 extends AnyRef Eliminated various hijinx from definitions.
* | | Updated checkfiles to subtract ScalaObject.Paul Phillips2012-02-049-25/+15
| | |
* | | Merge branch 'master' into topic/inlinePaul Phillips2012-02-039-1/+63
|\| |