summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* SI-5189 detect unsoundness when inferring type of matchAdriaan Moors2013-01-142-0/+14
| | | | | | | | | | | GADT skolems encode type slack that results from pattern matching on variant type constructors I thought they would not longer be relevant after cases have been typed, and since they caused weird issues with the old pattern matcher, I deskolemized in typedCase however, when we don't have an expected type for the match, we need to keep the skolems around until the skolemized type makes it out of the match and it becomes the result of type inference for that match when you do have an expected type, it will propagate to the case-level and the confrontation will thus already take place when typing individual cases
* Merge commit 'refs/pull/1844/head' into merge/pr-1844Paul Phillips2013-01-1113-38/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'refs/pull/1844/head': macroExpandAll is now triggered by typed SI-5923 adapt macros when they are deferred generalizes macroExpand typedPrimaryConstrBody now returns supercall more precise errors for macros parentTypes => typedParentTypes changes isTermMacro checks to something more universal fixes printing of AppliedTypeTree adds Trees.replace(Tree, Tree) makes macro override error more consistent refactors handling of macros in repl SI-5903 extractor macros do work adds c.macroRole Conflicts: src/compiler/scala/tools/nsc/typechecker/Macros.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| * macroExpandAll is now triggered by typedEugene Burmako2013-01-092-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously delayed macro expansions (the sole purpose of macroExpandAll) were triggered by `typedArgs`. Probably I wanted to save CPU cycles on not checking whether we have pending macro expansions on every iteration of typecheck. However this optimization is uncalled for, because the check just entails reading a var, therefore benefits of the current approach are negliible, whereas the robustness hit is tangible. After delayed macro expansion mechanism became more robust, it exposed a bug, well-hidden before. If one first delays a macro and then finds out that the expandee is erroneous, subsequent `macroExpandAll` will crash, because it expects a macro runtime attachment to be present. Previously the erroneous code path never got triggered, because the macro expansion never commenced. Luckily the fix was easy.
| * SI-5923 adapt macros when they are deferredEugene Burmako2013-01-099-29/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amazingly enough, the fix for the "macro not expanded" problem was super easy. (And I remember spending a day or two trying to find a quick fix somewhen around Scala Days 2012!) The problem was in the implementation of the macro expansion trigger, which was buried in a chain of if-elif-elif. This meant that macro expansion was mutually exclusive with a lot of important adaptations, e.g. with `instantiate`. More precisely, if an expandee contains an undetparam, its expansion should be delayed until all its undetparams are inferred and then retried later. Sometimes such inference can only happen upon a call to instantiate in one of the elif's coming after the macro expansion elif. However this elif would never be called for expandees, because control flow would always enter the macro expansion branch preceding the inference branch. Consequences of this fix are vast. First of all, we can get rid of the "type parameter must be specified" hack. Secondly and most importantly, we can now remove the `materializeImplicit` method from Implicits and rely on implicit macros to materialize tags for us. (This is a tricky change, and I'll do it later after we merge as much of my pending work as possible). Finally, we learn that the current scheme of interaction between macros, type inference and implicits is, in principle, sound!
| * makes macro override error more consistentEugene Burmako2013-01-093-3/+3
| |
* | SI-5378, unsoundness with type bounds in refinements.Paul Phillips2013-01-092-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the comment says: Not enough to look for abstract types; have to recursively check the bounds of each abstract type for more abstract types. Almost certainly there are other exploitable type soundness bugs which can be seen by bounding a type parameter by an abstract type which itself is bounded by an abstract type. SPECIAL: BUY ONE UNSOUNDNESS, GET ONE FREE In refinement types, only the first parameter list of methods was being analyzed for unsound uses of abstract types. Second parameter list and beyond had free unsoundness reign. That bug as well is fixed here.
* | SI-6566, unsoundness with alias variance.Paul Phillips2013-01-095-1/+48
| | | | | | | | | | | | | | This wasn't as bad as it could have been. All these changes plug soundness holes in trunk. Mostly we're looking at type aliases which were merely protected when they had to be protected[this] not to allow unsound variance crossover.
* | Boosted test coverage.Paul Phillips2013-01-094-0/+594
|/
* Merge branch '2.10.x'Adriaan Moors2013-01-0812-4/+120
|\ | | | | | | | | | | | | | | | | | | | | | | | | Patches applied: - rename of `dropRepeatedParamType` to `dropIllegalStarTypes` -- required since 8886d22cd6 - fixed test/files/neg/t6406-regextract.flags -- how could this have worked before? Conflicts: src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala src/library/scala/collection/LinearSeqOptimized.scala src/library/scala/util/Properties.scala test/files/run/streams.check test/files/run/streams.scala
| * 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 #1807 from scalamacros/topic/ident-deprecation-warningsEugene Burmako2012-12-303-0/+20
|\ \ | | | | | | the scanner is now less eager about deprecations
| * | changes the flags to not depend on partestEugene Burmako2012-12-281-1/+1
| | | | | | | | | | | | | | | | | | Due to some reason, partest always enables -deprecation. Since Paul has just submitted a pull request, which removes this behavior, I'm updating the flags to make sure this test works even after Paul's change.
| * | the scanner is now less eager about deprecationsEugene Burmako2012-12-253-0/+20
| | | | | | | | | | | | | | | | | | When healing braces it isn't very useful to report deprecation warnings, especially since this process is just simple context-free skimming, which can't know about what positions can accept what identifiers.
* | | Merge pull request #1814 from scalamacros/topic/reflectionEugene Burmako2012-12-298-16/+16
|\ \ \ | | | | | | | | adds extractors for TypeName, TermName and Modifiers
| * | | Changes reflection tests to use shorter name constructorsDen Shabalin2012-12-258-16/+16
| |/ /
* | | Fix and simplify typedTypeConstructor.Paul Phillips2012-12-2810-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Investigating the useful output of devWarning (-Xdev people, it's good for you) led back to this comment: "normalize to get rid of type aliases" You may know that this is not all the normalizing does. Normalizing also turns TypeRefs with unapplied arguments (type constructors) into PolyTypes. That means that when typedParentType would call typedTypeConstructor it would find its parent had morphed into a PolyType. Not that it noticed; it would blithely continue and unwittingly discard the type arguments by way of appliedType (which smoothly logged the incident, thank you appliedType.) The simplification of typedTypeConstructor: There was a whole complicated special treatment of AnyRef here which appears to have become unnecessary. Removed special treatment and lit a candle for regularity. Updated lots of tests regarding newly not-so-special AnyRef.
* | | Merge pull request #1786 from retronym/ticket/6745-3Paul Phillips2012-12-266-0/+38
|\ \ \ | | | | | | | | SI-6745 Fix <init> lookup
| * | | SI-6745 Fix <init> lookupJason Zaugg2012-12-186-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | We should only consult the decls of the enclosing class. Members of the self type, enclosing scopes, or imports should not be considered.
* | | | Removed old pattern matcher.Paul Phillips2012-12-269-50/+27
| |/ / |/| |
* | | Merge pull request #1506 from som-snytt/issue/6446-plugin-descPaul Phillips2012-12-2217-0/+192
|\ \ \ | | | | | | | | PluginComponent contributes description to -Xshow-phases. (Fixes SI-6446)
| * | | PluginComponent contributes description to -Xshow-phases.Som Snytt2012-12-1817-0/+192
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Global, SubComponent is called a phase descriptor, but it doesn't actually have a description. (Phase itself does.) This fix adds a description to PluginComponent so that plugins can describe what they do in -Xshow-phases. Elliptical descriptions Exploded archives Plugged-in partest Roundup at the Little h!
* | | Merge pull request #1769 from soc/SI-6809Adriaan Moors2012-12-202-19/+6
|\ \ \ | | | | | | | | SI-6809 Forbids deprecated case class definitions without parameter list
| * | | SI-6809 Forbids deprecated case class definitions without parameter listSimon Ochsenreither2012-12-132-19/+6
| | | | | | | | | | | | | | | | This has been deprecated since at least 2.7.7, so it should be good to go.
* | | | Merge remote-tracking branch 'origin/2.10.x' into merge-2.10.xPaul Phillips2012-12-2022-32/+197
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: (31 commits) Implicit vars should have non-implicit setters. Deprecate `scala.tools.nsc.Phases` because it's dead-code. scaladoc Template: remove duplicate code and several usages of Option.get. adds scala-reflect.jar to MIMA in ant Test showing the absence of a forward reference update mailmap Remove dead code from `Global`. Cleanup MemberLookup. Better explain ambiguous link targets. typedIdent no longer destroys attachments fixes incorrect handling of Annotated in lazy copier simplifies checkBounds Recurse into instantiations when stripping type vars. Extract base scaladoc functionality for the IDE. Expand pattern match position tests. SI-6288 Remedy ill-positioned extractor binding. SI-6288 Fix positioning of label jumps SI-6288 Position argument of unapply Fixes SI-6758: force LazyAnnnotationInfo for DefDef and TypeDef SI-6795 Simplify errors related to "abstract override" on type members SI-6795 Adds negative check for "abstract override" on types in traits ... Conflicts: .mailmap src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/ast/DocComments.scala src/compiler/scala/tools/nsc/doc/base/CommentFactoryBase.scala src/compiler/scala/tools/nsc/doc/html/page/Source.scala src/compiler/scala/tools/nsc/doc/html/page/Template.scala src/compiler/scala/tools/nsc/doc/model/LinkTo.scala src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala test/scaladoc/run/links.scala
| * | 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 branch 'merge-wip-into-2.10.x' into merge-2.10-into-masterPaul Phillips2012-12-1126-30/+248
|\| | | | | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * merge-wip-into-2.10.x: (44 commits) Cleanups of reifyBoundTerm and reifyBoundType SI-5841 reification of renamed imports Share the empty LinkedList between first0/last0. SI-4922 Show default in Scaladoc for generic methods. SI-6614 Test case for fixed ArrayStack misconduct. SI-6690 Release reference to last dequeued element. SI-5789 Use the ReplTest framework in the test SI-5789 Checks in the right version of the test SI-5789 Removes assertion about implclass flag in Mixin.scala SI-6766 Makes the -Pcontinuations:enable flag a project specific preference more ListOfNil => Nil DummyTree => CannotHaveAttrs evicts assert(false) from the compiler introduces global.pendingSuperCall refactors handling of parent types unifies approaches to call analysis in TreeInfo TypeApply + Select and their type-level twins SI-6696 removes "helper" tree factory methods SI-6766 Create a continuations project in eclipse Now the test suite runs MIMA for compatibility testing. ... Conflicts: src/compiler/scala/reflect/reify/codegen/GenUtils.scala src/compiler/scala/tools/nsc/ast/Trees.scala src/compiler/scala/tools/nsc/backend/icode/GenICode.scala src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala src/compiler/scala/tools/nsc/typechecker/Contexts.scala src/compiler/scala/tools/nsc/typechecker/Namers.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/eclipse/scala-compiler/.classpath src/eclipse/scalap/.classpath src/reflect/scala/reflect/internal/StdNames.scala src/reflect/scala/reflect/internal/TreeInfo.scala
| * | | 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.