summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* 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.
| | * | | | Warn when generated classfiles differ only in case.Paul Phillips2012-12-053-0/+22
| | |/ / / | | | | | | | | | | | | | | | | | | | | We should most likely prohibit it completely, but warning is a start.
| * | | | Merge pull request #1700 from retronym/ticket/6535Adriaan Moors2012-12-102-0/+21
| |\ \ \ \ | | | | | | | | | | | | SI-6535 Step back from the precipice of a cycle
| | * | | | SI-6535 Step back from the precipice of a cycleJason Zaugg2012-12-042-0/+21
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding any non-local parent to WrapAsScala will trigger a valid cyclic reference error. By moving the import of `Wrapper._` inside `WrapAsScala` and `WrapAsJava`, it is not in scope when typing the parents of those, and we avoid the cycle. Adds a test case to show the essense of the promiscious mutual imports that triggers this.
| * | | | Merge pull request #1675 from retronym/ticket/6667-2Adriaan Moors2012-12-104-0/+61
| |\ \ \ \ | | |_|_|/ | |/| | | SI-6667 Abort after any ambiguous in-scope implicit
| | * | | SI-6667 Abort after any ambiguous in-scope implicitJason Zaugg2012-11-264-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than continuing on to a search of implicits of the expected type. Previously, the companion implicits were searched if the the caller was running the implicit search in silent mode, for example if searching for an implicit parameter in an application which has an expected type. After this commit, the behaviour is consistent, regardless on silent/non-silent typing.
| * | | | Merge pull request #1668 from scalamacros/topic/pre-typemacrosAdriaan Moors2012-12-0710-28/+13
| |\ \ \ \ | | | | | | | | | | | | refactors handling of parent types
| | * | | | refactors handling of parent typesEugene Burmako2012-12-0610-28/+13
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment parser does too much w.r.t handling of parent types. It checks whether a parent can have value arguments or not and more importantly, it synthesizes constructors and super calls. This approach is fundamentally incompatible with upcoming type macros. Take for example the following two snippets of code: `class C extends A(2)` `class D extends A(2) with B(3)` In the first snippet, `A` might be a type macro, therefore the super call `A.super(2)` eagerly emitted by the parser might be meaningless. In the second snippet parser will report an error despite that `B` might be a type macro which expands into a trait. Unfortunately we cannot simply augment the parser with the `isTypeMacro` check. This is because to find out whether an identifier refers to a type macro, one needs to perform a typecheck, which the parser cannot do. Therefore we need a deep change in how parent types and constructors are processed by the compiler, which is implemented in this commit.
| * / | | SI-6696 removes "helper" tree factory methodsEugene Burmako2012-12-061-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As experience shows, these methods can easily be a source of confusion for the newcomers: https://issues.scala-lang.org/browse/SI-6696. I'm only leaving the TypeTree(tp) factory, since the facility to set underlying types for type trees is not exposed in the public API, as it's inherently mutable.
* | | | Merge branch 'merge-2.10-wip' into merge-2.10Paul Phillips2012-12-057-2/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * merge-2.10-wip: Fixing OSGi distribution. Fix for rangepos crasher. SI-6685 fixes error handling in typedApply Test cases for SI-5726, SI-5733, SI-6320, SI-6551, SI-6722. Asserts about Tree qualifiers. Fix for SI-6731, dropped trees in selectDynamic. neg test added SI-5753 macros cannot be loaded when inherited from a class or a trait Take advantage of the margin stripping interpolator. Adds a margin stripping string interpolator. SI-6718 fixes a volatile test Mark pattern matcher synthetics as SYNTHETIC. Set symbol flags at creation. Fix for SI-6687, wrong isVar logic. Fix for SI-6706, Symbol breakage under GC. findEntry implementation code more concise and DRYer. Fix for SI-6357, cycle with value classes. Refactoring of adaptMethod SI-6677 Insert required cast in `new qual.foo.T` Conflicts: src/compiler/scala/tools/nsc/transform/Erasure.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/internal/SymbolTable.scala src/reflect/scala/reflect/internal/util/package.scala test/files/neg/gadts1.check
| * | | 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.