summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2079 from JamesIry/2.10.x_SI-7070James Iry2013-02-073-6/+7
|\ | | | | SI-7070 Turn restriction on companions in pkg objs into warning
| * SI-7070 Turn restriction on companions in pkg objs into warningJames Iry2013-02-063-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The implementation restriction created from SI-5954 in 3ef487ecb6733bfe3c13d89780ebcfc81f9a5ea0 has two problems. 1) The problematic code works fine if compile with sbt. That means the restriction is breaking some people needlessly. 2) It's not binary compatible. To fix all that this commit changes the error into a warning and removes the setting used to get around the restriction.
* | Merge pull request #2068 from scalamacros/ticket/7064Adriaan Moors2013-02-0710-13/+28
|\ \ | | | | | | [nomaster] SI-7064 Reflection: forward compat for 2.10.1
| * | [nomaster] Revert "refactors handling of parent types"Eugene Burmako2013-02-057-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 40063b0009d55ed527bf1625d99a168a8faa4124. Conflicts: src/compiler/scala/tools/nsc/ast/parser/Parsers.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| * | [nomaster] Revert "introduces global.pendingSuperCall"Eugene Burmako2013-02-053-3/+6
| |/ | | | | | | | | | | | | | | This reverts commit 0ebf72b9498108e67c2133c6522c436af50a18e8. Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/internal/Trees.scala
* / [nomerge] SI-6667 Demote a new ambiguity error to a lint warning.Jason Zaugg2013-02-044-2/+6
|/ | | | | | | In the interests of not breaking source compability. A few projects are relying on this bug. Should not be merged to master.
* Merge pull request #2022 from lrytz/analyzerPlugins210Lukas Rytz2013-02-033-3/+32
|\ | | | | Analyzer Plugins
| * SI-1803, plus documentation and cleanups in Namers, mainly in typeSigLukas Rytz2013-02-033-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - when typing (and naming) a ValDef, tpt and rhs are now type checked in the same context (the inner / ValDef context). this does not change any behavior, but is more uniform (same as for DefDef). martin told me (offline) that this change is desirable if it doesn't break anything. (it doesn't). - typeSig is now more uniform with a separate method for each case (methodSig, valDefSig, etc). methodSig was cleaned up (no more variables) and documented. the type returned by methodSig no longer contains / refers to type skolems, but to the actual type parameters (so we don't need to replace the skolems lateron). - documentation on constructor contexts, type skolems - more tests for SI-5543
* | Merge pull request #2019 from scalamacros/ticket/6539Eugene Burmako2013-02-012-1/+7
|\ \ | |/ |/| SI-6539 moves @compileTimeOnly away from scala-reflect
| * SI-6539 moves @compileTimeOnly away from scala-reflectEugene Burmako2013-01-312-1/+7
| | | | | | | | | | | | | | | | The move is done to provide forward compatibility with 2.10.0. The annotation isn't replaced with one of the macro-based solutions right away (see comments for more information about those), because we lack necessary tech in 2.10.x.
* | Merge pull request #1975 from retronym/ticket/6601-revertJames Iry2013-02-013-8/+0
|\ \ | | | | | | Revert "SI-6601 Publicise derived value contstructor after pickler"
| * | Revert "SI-6601 Publicise derived value contstructor after pickler"Jason Zaugg2013-01-263-8/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b07228aebe7aa620af45a681ef60d945ffc65665. The remedy was far worse than the disease: % cat sandbox/test.scala class V private (val a: Any) extends AnyVal % RUNNER=scalac scala-hash b07228aebe sandbox/test.scala [info] b07228aebe => /Users/jason/usr/scala-v2.10.0-256-gb07228a % scala-hash b07228aebe [info] b07228aebe => /Users/jason/usr/scala-v2.10.0-256-gb07228a Welcome to Scala version 2.10.1-20130116-230935-b07228aebe (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27). Type in expressions to have them evaluated. Type :help for more information. scala> def foo(v: V) = v.a == v.a exception when typing v.a().==(v.a())/class scala.reflect.internal.Trees$Apply constructor V in class V cannot be accessed in object $iw in file <console> scala.reflect.internal.Types$TypeError: constructor V in class V cannot be accessed in object $iw
* | Merge pull request #1980 from retronym/backport/1518Adriaan Moors2013-02-014-0/+47
|\ \ | | | | | | [backport] SI-2968 Fix brace healing for `^case (class|object) {`
| * | [backport] SI-2968 Fix brace healing for `^case (class|object) {`Jason Zaugg2013-01-264-0/+47
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 24828531f62ce05402c96c04d7096e82d5f4e3bf Author: Jason Zaugg <jzaugg@gmail.com> Date: Sun Oct 21 23:34:35 2012 +0200 SI-2968 Fix brace healing for `^case (class|object) {` 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. (cherry picked from commit cbad218dba47d49a39897b86d467c384538fdd53)
* | Merge pull request #1998 from JamesIry/2.10.x_6963_2Adriaan Moors2013-02-019-6/+45
|\ \ | | | | | | SI-6963 Add version to -Xmigration
| * | SI-6963 Add version to -XmigrationJames Iry2013-01-299-6/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an optional version parameter to the -Xmigration compiler setting. Doing -Xmigration without version number behaves as it used to by dumping every possible migration warning. This commit adds a ScalaVersion class (plus ancillary stuff), and a ScalaVersionSetting.
* | | Merge pull request #2015 from paulp/rc1-backportsPaul Phillips2013-01-316-2/+21
|\ \ \ | | | | | | | | 10 backports
| * | | SI-6426, importable _.Paul Phillips2013-01-302-0/+12
| | | | | | | | | | | | | | | | | | | | [backport] Prohibit `_` as an identifier, it can only bring badness.
| * | | SI-5353, imperfect error message.Paul Phillips2013-01-304-2/+9
| |/ / | | | | | | | | | | | | [backport] The fix of course is a perfect error message.
* | | Merge pull request #2000 from adriaanm/backport-pr-1873Paul Phillips2013-01-312-0/+85
|\ \ \ | | | | | | | | [backport] SI-5378, unsoundness with type bounds in refinements.
| * | | [backport] SI-5378, unsoundness with type bounds in refinements.Paul Phillips2013-01-282-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.
* | | Merge pull request #2036 from scalamacros/ticket/5716Paul Phillips2013-01-313-0/+20
|\ \ \ | | | | | | | | [backport] the scanner is now less eager about deprecations
| * | | changes the flags to not depend on partestEugene Burmako2013-01-311-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. Backport from https://github.com/scala/scala/pull/1807 Original commit is https://github.com/scala/scala/commit/2015ad3ebd833225e93ed19604760a6da2522bb1
| * | | the scanner is now less eager about deprecationsEugene Burmako2013-01-313-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. Backport from https://github.com/scala/scala/pull/1807. Original commit is https://github.com/scala/scala/commit/e5d34d70499504e085ddf957c1c818ffb63f4e8d.
* | | Merge pull request #1989 from adriaanm/rework-pr-1945Paul Phillips2013-01-313-56/+0
|\ \ \ | | | | | | | | SI-6968 Simple Tuple patterns aren't irrefutable
| * | | SI-6968 Simple Tuple patterns aren't irrefutableJason Zaugg2013-01-273-56/+0
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverts part of c82ecab. The parser can't assume that a pattern `(a, b)` will match, as results of `.isInstanceOf[Tuple2]` can't be statically known until after the typer. The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing this regression SI-6968. Keeping all of those fixed will require a better definition of irrefutability, and some acrobatics to ensure safe passage to the ambiguous trees through typechecking.
* / | SI-6728 Fixes crash in parser on incomplete for expressionJames Iry2013-01-302-0/+9
|/ / | | | | | | | | | | | | | | | | | | The parser was trying to take the position of an empty expression which would crash. Son on the empty expression case in TreeBuilder# makeWhile it tries to do that and, if that failed, gets a position that wraps both the condition and the body. I also made a slight improvement to the UnsupportedOperationEx messages in Position.
* | Merge pull request #1857 from retronym/ticket/6443-2.10.xAdriaan Moors2013-01-272-0/+28
|\ \ | |/ |/| SI-6443 Widen dependent param types in uncurry
| * SI-6443 Widen dependent param types in uncurryJason Zaugg2013-01-162-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bridge building operates on unusual method signatures: after uncurry, so parameter lists are collapsed; but before erasure, so dependently typed parameters are still around. Original: def foo(a: T)(b: a.type, c: a.U): Unit During computeBridges: (a: T, b: a.type, c: a.U)Unit This signature no longer appears to override the corresponding one in a superclass, because the types of `b` and `c` are dependent on method parameters. The root of the problem is uncurry, which leaves the trees in a poor state. This commit changes uncurry to remedy this. An example illustrates it best: // source def foo(a: A)(b: a.type): b.type = b // post uncurry before this patch. // not well typed code! def foo(a: A, b: a.type): a.type = { // post uncurry after this patch def foo(a: A, b: A): A = { val b$1 = b.asInstanceOf[a.type] b$1 }
* | Merge pull request #1946 from retronym/ticket/6231Paul Phillips2013-01-252-0/+21
|\ \ | | | | | | SI-6231 Report unsupported free var capture by a trait.
| * | SI-6231 Report unsupported free var capture by a trait.Jason Zaugg2013-01-212-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a class nested in a trait captures a free variable from the enclosing scope of the trait, the transformation to add that variable to the `init` method of the trait implementation class happens *after* the abstract trait interface has been extracted. This would lead to a crash when trying to find the corresponding interface method. This commit detects this situation and reports an implementation restriction. The enclosed test case shows a workaround. To lift this restriction, LambdaLifter should add the getters and make sure they end up in the trait interface. Looks like Martin tried this once: // LambdaLift.scala // // Disabled attempt to to add getters to freeParams // this does not work yet. Problem is that local symbols need local names // and references to local symbols need to be transformed into // method calls to setters. // def paramGetter(param: Symbol): Tree = { // val getter = param.newGetter setFlag TRANS_FLAG resetFlag PARAMACCESSOR // mark because we have to add them to interface // sym.info.decls.enter(getter) // val rhs = Select(gen.mkAttributedThis(sym), param) setType param.tpe // DefDef(getter, rhs) setPos tree.pos setType NoType // } // val newDefs = if (sym.isTrait) freeParams ::: (ps map paramGetter) else freeParams
* | | Merge pull request #1938 from retronym/ticket/6666Paul Phillips2013-01-252-0/+172
|\ \ \ | | | | | | | | SI-6666 Restrict hidden `this` access in self/super calls.
| * | | SI-6666 Restrict hidden `this` access in self/super calls.Jason Zaugg2013-01-202-0/+172
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect when classes (user authored or compiler generated) local to a self or super constructor argument would require premature access to the in-construction instance. The same restriction applies for classes and objects; for objects, the premature access would result in a null via MODULE$ field. A residual error has been lodged as SI-6997. I'd like to remove calls to `Symbol#outerClass` (which relies on the flaky flag INCONSTRUCTOR, see my comments in the JIRA issue for more discussion) from `LambdaLift` and `ExplicitOuter`, and instead use the stack of active self/super calls to know when to skip an enclosing class. That will obviate that flag.
* | | Merge pull request #1928 from retronym/ticket/6902Paul Phillips2013-01-253-0/+34
|\ \ \ | | | | | | | | SI-6902 Check unreachability under @unchecked
| * | | SI-6902 Check unreachability under @uncheckedJason Zaugg2013-01-193-0/+34
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Only exhaustiveness checking should be disabled if the scrutinee of a match as annotated as `: @unchecked`. This was the pre-2.10.x behaviour. This also fixes a variation of the closed ticket, SI-6011. The exhaustiveness check is needed to safely fallback from emitting a table switch if duplicate cases are detected.
* | | Merge pull request #1907 from namin/si-6952Paul Phillips2013-01-253-1/+20
|\ \ \ | | | | | | | | Closes SI-6952: add correct error positions for Dynamic feature check.
| * | | Closes SI-6952: add correct error positions for Dynamic feature check.amin2013-01-163-1/+20
| | | |
* | | | [backport] SI-6567 Warning for Option(implicitView(foo))Jason Zaugg2013-01-233-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 284bd754fa5dfc8bc626b0c5ebe85d872dd044cb Author: Jason Zaugg <jzaugg@gmail.com> Date: Sat Nov 3 16:19:46 2012 +0100 SI-6567 Warning for Option(implicitView(foo)) I've seen the reported problem before in the wild. It seems worthy of a special warning, so long as we advocate Option.apply as an alternative to `if (x == null) Some(x) else None`. It is behind -Xlint at the moment, an option that could do with some promotion. (cherry picked from commit 0bcb9e9169146e3f589c6c9f65cc4a5523b78120)
* | | | Removed class files.Paul Phillips2013-01-212-0/+0
| |_|/ |/| | | | | | | | Someone checked in a pair of .class files.
* | | Merge pull request #1914 from retronym/ticket/6601Grzegorz Kossakowski2013-01-173-0/+8
|\ \ \ | | | | | | | | SI-6601 Publicise derived value contstructor after pickler
| * | | SI-6601 Publicise derived value contstructor after picklerJason Zaugg2013-01-163-0/+8
| | |/ | |/| | | | | | | | | | | | | | | | Otherwise the access restrictions are not enforced under separate compilation. See also SI-6608.
* | | Merge pull request #1854 from pufuwozu/ticket-SI-6923Paul Phillips2013-01-173-2/+21
|\ \ \ | |_|/ |/| | SI-6923 Context now buffers warnings as well as errors
| * | SI-6923 Context now buffers warnings as well as errorsBrian McKenna2013-01-073-2/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Code that was silently typed would not report warnings, even if it returned a successful result. This appeared in the following code which didn't show warnings even with -Ywarn-adapted-args: def foo(a: Any) = a; foo(1, 2) While the following would show the expected warning: def foo[A](a: Any) = a; foo(1, 2)
* | Merge pull request #1895 from JamesIry/SI_6963_2.10.xPaul Phillips2013-01-153-0/+6
|\ \ | | | | | | SI-6963 Deprecates -Xmigration switch
| * | SI-6963 Deprecates -Xmigration switchJames Iry2013-01-143-0/+6
| | | | | | | | | | | | | | | | | | -Xmigration is specific to the 2.7 to 2.8 upgrade and is no longer relevant. There is no plan to maintain it so it will be removed. This commit deprecates it in anticipation.
* | | Merge pull request #1888 from retronym/ticket/6675Paul Phillips2013-01-156-0/+36
|\ \ \ | | | | | | | | SI-6675 -Xlint arity enforcement for extractors
| * | | SI-6675 Test new warning under -Xoldpatmat.Jason Zaugg2013-01-153-0/+18
| | | | | | | | | | | | | | | | This commit should be discarded when merging to master.
| * | | SI-6675 -Xlint arity enforcement for extractorsJason Zaugg2013-01-153-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extractor Patterns changed in 2.10.0 to implement the letter of the spec, which allows a single binding to capture an entire TupleN. But this can hide arity mismatches, especially if the case body uses the bound value as an `Any`. This change warns when this happens under -Xlint.
* | | | Merge pull request #1894 from retronym/ticket/6082Adriaan Moors2013-01-142-0/+15
|\ \ \ \ | | | | | | | | | | SI-6082 Conditionally expand @ann(x) to @ann(value = x)
| * | | | SI-6082 Conditionally expand @ann(x) to @ann(value = x)Jason Zaugg2013-01-132-0/+15
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... if the annotation has an argument with the name `value`. Doing so unconditionally obscures error messages. We still require that arguments to ClassFileAnnotations are named, other than for this special case.