summaryrefslogtreecommitdiff
path: root/test/files/neg
Commit message (Collapse)AuthorAgeFilesLines
* SI-8040 Xlint enables unused warningsSom Snytt2017-03-1110-10/+9
| | | | | | | | | | | | `-Ywarn-unused-import` is deprecated in favor of `-Ywarn-unused:imports`. `-Xlint` does not yet enable `-Ywarn-unused:patvars`. But the default for `-Ywarn-unused` is everything, including `patvars`. So `-Xlint:unused` is the populist option, `-Ywarn-unused` more exclusive. Tests are fixed by narrowing scope of `-Xlint` when specified.
* SI-8040 No warn args to super, main argsSom Snytt2017-03-115-4/+28
| | | | | | | | | | | | | `class B(x: X) extends A(x)` uses `x` in ctor, where it is detectable as an ordinary param. `implicit class C(val s: String)` may not use `s` in extension methods, so don't warn. Don't warn required args to main method. Don't warn about synthetic isDefinedAt in anonymous functions, or about defaultCase$.
* SI-7860 No warn private implicit value classSom Snytt2017-03-115-1/+64
| | | | | | | | | | | | Previously, warned on unused synthetic companion. Also avoid false negative via hashcode reference to the underlying value. Avoid the synthetic conversion method for the implicit class (whose RHS always uses the class); the def itself is synthetic so is normally not warned.
* SI-8040 Warn patvars in casedefsSom Snytt2017-03-112-2/+24
| | | | | | | | Collect bindings in casedefs unless "@-bound to _". Also minor refactor to make it easier to see the cases of `id @ _`. Tupled matching is supposed to be efficient either now or soon.
* SI-9839 Avoid crash in macro import selector posSom Snytt2017-03-113-1/+23
| | | | | | Ignore bad name pos. Also delete unused val. Thanks, `-Ywarn-unused`!
* SI-8040 Warn unused parametersSom Snytt2017-03-1110-4/+132
| | | | | | | | | | | | | | | | | | | | One can `-Ywarn-unused:params` or more narrowly warn only for unused implicit parameters with `-Ywarn-unused:implicits`. Params includes constructor parameters. The settings for privates and locals are not yet distinguished. ``` $ skalac -Ywarn-unused:help Enable or disable specific `unused' warnings imports Warn if an import selector is not referenced. patvars Warn if a variable bound in a pattern is unused. privates Warn if a private member is unused. locals Warn if a local definition is unused. params Warn if a value parameter is unused. implicits Warn if an implicit parameter is unused. ```
* SI-8040 Warn unused flagsSom Snytt2017-03-114-1/+65
| | | | | | | | | | | | | | | | Introduce `-Ywarn-unused:x,y,z` and exploit `-Ywarn-unused:patvars`. Although the tree attachment for shielding patvars from warnings is not structural, sneaking the settings flag into the reflection internal TreeGen is awkward. Add test to ensure isolation of patvars warning from others. `-Ywarn-unused-import` is an alias for `-Ywarn-unused:imports`. `-Xlint:unused` is an alias for `-Ywarn-unused`, but not enabled yet. The help text advises to use `-Ywarn-unused`. The future can decide if `-Xlint:unused-imports` is warranted.
* SI-9158 No warn for comprehension patvarsSom Snytt2017-03-112-4/+21
| | | | | | | | | | | | | | | | | Midstream assignments should not cause unused warnings. Currently the encoding doesn't pass them along, but passes the value from which they were destructured. For for-comprehensions only, the patvar transform tags the binds so that they are not warned if they turn up in a valdef and are unused. Extractors are invoked multiple times if the patvar is used later, as noted on the ticket. In a yield, the valdef is emitted only if the patvar is referenced (possibly saving the extra extraction), so there is no warning there currently.
* SI-8040 Warn unused pattern varsSom Snytt2017-03-112-1/+51
| | | | | | | | | | | | Warn for unused `case X(x) =>` but, as an escape hatch, not for `case X(x @ _) =>`. The latter form is deemed documentary. (Named args could serve a similar purpose, `case X(x = _) =>`.) An attachment is used to mark the bound var, and the symbol position is used to correlate the identifier with the variable that is introduced. This mechanism doesn't work yet when only a single var is defined.
* SI-8040 Improve unused warningsSom Snytt2017-03-112-21/+75
| | | | | | | Add symbol names, don't warn for both getters and setters or for synthetics (except default arg getters). Tweak messages for readability.
* Merge pull request #5622 from edmundnoble/extra-errsAdriaan Moors2017-03-023-8/+8
|\ | | | | Improved error messages for identically named, differently prefixed types
| * Match error lengthsEdmund Noble2017-02-071-1/+1
| |
| * Improved error messages for identically named, differently prefixed typesEdmund Noble2016-12-313-8/+8
| |
* | SI-10207 Error before update conversionSom Snytt2017-02-262-0/+20
| | | | | | | | | | | | Gaze deeper for errors before committing to conversion of assignment to update. The error buried in the transformed tree escapes notice of retypechecking and leaks to backend.
* | Revert "SI-10133 Require escaped single quote char lit"Adriaan Moors2017-02-213-15/+2
| |
* | Merge pull request #5629 from som-snytt/issue/10120-quote-errAdriaan Moors2017-02-203-2/+15
|\ \ | | | | | | SI-10133 Require escaped single quote char lit
| * | SI-10120 Extra advice on unclosed char literalSom Snytt2017-01-083-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Folks from other languages might mistakenly enclose a string in single quotes. Since this presents as a symbol literal followed by the unpaired single quote, we can add a syntax reminder. Also polish the wording for bad string interpolation.
| * | SI-10133 Require escaped single quote char litSom Snytt2017-01-082-1/+8
| |/ | | | | | | | | | | The spec specifically requires `'\''` and not `'''`. The error consumes all consecutive single quotes.
* | Merge pull request #5648 from som-snytt/issue/10148Seth Tisue2017-02-162-2/+25
|\ \ | | | | | | SI-10148 Follow Java for float literals
| * | SI-10148 Follow Java for float literalsSom Snytt2017-01-182-2/+25
| |/ | | | | | | | | Use `Float.parseFloat` instead of converting from Double. Error when a value rounds to zero.
* | Merge pull request #5546 from som-snytt/issue/9636Adriaan Moors2017-02-164-1/+25
|\ \ | | | | | | SI-9636 More precise error pos on apply inference
| * | SI-9636 More precise error pos on apply inferenceSom Snytt2016-12-204-1/+25
| |/ | | | | | | | | If a method type arg is inferred Any, warn about the function and not the innocent arg.
* | Merge pull request #5662 from teldosas/SI-9675Adriaan Moors2017-02-163-0/+52
|\ \ | | | | | | SI-9675 warn about non-sensible equals in anonymous functions
| * | Add warning about non-sensible equals in anonymous functionsteldosas2017-02-013-0/+52
| |/
* | Merge pull request #5542 from retronym/ticket/10066Adriaan Moors2017-02-162-0/+45
|\ \ | | | | | | SI-10066 Fix crash in erroneous code with implicits, dynamic
| * | SI-10066 Fix crash in erroneous code with implicits, dynamicJason Zaugg2016-11-182-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiler support in the typechecker for `scala.Dynamic` is very particular about the `Context` in which it is typechecked. It looks at the `tree` in the enclosing context to find the expression immediately enclosing the dynamic selection. See the logic in `dyna::mkInvoke` for the details. This commit substitutes the result of `resetAttrs` into the tree of the typer context before continuing with typechecking.
* | | Correct the AbstractVar error messageJon Pretty2017-02-093-5/+5
| | | | | | | | | | | | | | | | | | | | | The error currently reads "only classes can have declared but undefined members", which isn't true on two counts: traits can have them, and concrete classes cannot. This corrects the error message to read "only traits and abstract classes can have declared but undefined members".
* | | Merge pull request #5245 from dwijnand/trailing-commasAdriaan Moors2017-02-082-0/+186
|\ \ \ | | | | | | | | SI-4986 The glorious return of Comma McTraily
| * | | SI-4986 SIP-27 Trailing Comma (multi-line only) supportDale Wijnand2016-12-112-0/+186
| | | |
* | | | Merge pull request #5646 from som-snytt/issue/8685Adriaan Moors2017-02-071-1/+4
|\ \ \ \ | | | | | | | | | | SI-8685 Warn on deprecated case ctor
| * | | | SI-8685 Warn on deprecated case ctorSom Snytt2017-01-161-1/+4
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The narrow use case in the ticket was just to warn on `C.apply` when the constructor has been deprecated. Someone added code to warn after the apply is rewritten, but it wasn't checking the constructor (and the tree was checked before but not after transform).
* | | | Merge pull request #5585 from som-snytt/issue/10097Adriaan Moors2017-02-0710-2/+45
|\ \ \ \ | | | | | | | | | | SI-10097 Error if no non-implicit case class param
| * | | | SI-10097 Adapt unless -Xsource:2.13Som Snytt2016-12-145-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For 2.12 migration, insert missing case class param section, strip caseaccessor from implicit paramsection, and deprecate the adaptation.
| * | | | SI-8704 Also warn if effectively multiple implicitSom Snytt2016-12-143-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current semantics are that leading implicit param turns the parameter section into an implicit section (though without making other params implicitly implicit). Warn if more than one head of a param section is implicit, since that results in multiple implicit param sections.
| * | | | SI-8704 Error on bad implicit sectionsSom Snytt2016-12-144-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of aborting when a class def has extra parameter section, take all parameter sections and sanity check the use of leading implicit to indicate an implicit parameter section.
| * | | | SI-10097 Error if no non-implicit case class paramSom Snytt2016-12-143-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Case class must have a non-implicit param list. Error early, error often. Also update spec to say that class implicitly gets a non-implicit parameter section if it doesn't have one, and that a case class must have one.
* | | | | Merge pull request #5667 from som-snytt/issue/maxerrsLukas Rytz2017-02-036-0/+94
|\ \ \ \ \ | | | | | | | | | | | | SI-9729 -Xmaxerrs to limit messages
| * | | | | SI-9729 -Xmaxerrs to limit messagesSom Snytt2017-01-316-0/+94
| | |/ / / | |/| | | | | | | | | | | | | | | | | | Since 2.7.2, console reporter has limited error messages to a fixed 100. Use `-Xmaxerrs -Xmaxwarns` as from `javac` to configure.
* / | | | adjust to partest 1.1.0's new mixed Java/Scala compilationLukas Rytz2017-01-275-8/+8
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | upgrades partest from 1.0.17 to 1.1.0 https://github.com/scala/scala-partest/pull/69 changed the mode for mixed compilation, which used to be 1. scalac *.java *.scala -d o 2. javac *.java -d o -cp o 3. scalac *.scala -d o -cp o Now the third step is skipped. This required some adjustments to existing tests. - t7014 is split in two groups, the fix is for separate compilation. - t7582 is also split. It tests inliner warnings when inling code that accesses Java-defined package-private code. Inlining from Java only works in separate compilation (no bytecode available in mixed compilation). - Java compiler warnings of "run" tests were not reported in the old scheme, now they are. Deprecation / unchecked warnings were removed from t6240, t8786, varargs. - t4788 required a .check file update to pass, which hints at a bug. I will re-open SI-4788 and investigate later.
* | | | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2016-12-2013-0/+138
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20161220 Conflicts: bincompat-backward.whitelist.conf build.xml src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/collection/immutable/NumericRange.scala
| * \ \ \ Merge pull request #5487 from lrytz/java-constantsAdriaan Moors2016-12-157-0/+104
| |\ \ \ \ | | | | | | | | | | | | SI-3236 constant types for literal final static java fields
| | * | | | neg test for parsing constants in Java sourcesLukas Rytz2016-11-027-0/+104
| | | | | |
| * | | | | SI-9834 Show expansion of update on errorSom Snytt2016-11-251-0/+1
| | | | | |
| * | | | | SI-9834 Improve error on failed op=Som Snytt2016-11-256-0/+33
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If rewriting `x += y` fails to typecheck, emit error messages for both the original tree and the assignment. If rewrite is not attempted because `x` is a val, then say so. The error message at `tree.pos` is updated with the additional advice. SI-8763 Crash in update conversion When there are already errors, don't attempt mechanical rewrites.
| * | | | Merge pull request #5343 from milessabin/topic/si-2712-backportAdriaan Moors2016-10-188-0/+78
| |\ \ \ \ | | | | | | | | | | | | SI-2712 Add support for higher order unification
| | * | | | SI-2712 Add support for higher order unificationMiles Sabin2016-08-158-0/+78
| | | | | |
| * | | | | Partial fix for SI-7046Miles Sabin2016-08-156-0/+85
| |/ / / /
| * | | | Update partest to 1.0.12, test case for reporting invalid flagsLukas Rytz2016-02-174-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: test/files/pos/t3420.flags versions.properties
* | | | | SI-10068 Only permit elidable methodsSom Snytt2016-12-143-0/+23
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | In refchecks, check that symbol with `@elidable` is a method. When eliding in uncurry, doublecheck. The check is enabled under `-Xsource:2.13`.
* | | | Merge pull request #5558 from larsrh/topic/deprecated-y-flagsAdriaan Moors2016-12-133-13/+0
|\ \ \ \ | | | | | | | | | | Remove deprecated -Y flags