| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
`-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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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$.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Ignore bad name pos.
Also delete unused val. Thanks, `-Ywarn-unused`!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Add symbol names, don't warn for both getters and setters
or for synthetics (except default arg getters).
Tweak messages for readability.
|
|\
| |
| | |
Improved error messages for identically named, differently prefixed types
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|\ \
| | |
| | | |
SI-10133 Require escaped single quote char lit
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/
| |
| |
| |
| |
| | |
The spec specifically requires `'\''` and not `'''`.
The error consumes all consecutive single quotes.
|
|\ \
| | |
| | | |
SI-10148 Follow Java for float literals
|
| |/
| |
| |
| |
| | |
Use `Float.parseFloat` instead of converting from Double.
Error when a value rounds to zero.
|
|\ \
| | |
| | | |
SI-9636 More precise error pos on apply inference
|
| |/
| |
| |
| |
| | |
If a method type arg is inferred Any, warn about the
function and not the innocent arg.
|
|\ \
| | |
| | | |
SI-9675 warn about non-sensible equals in anonymous functions
|
| |/ |
|
|\ \
| | |
| | | |
SI-10066 Fix crash in erroneous code with implicits, dynamic
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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".
|
|\ \ \
| | | |
| | | | |
SI-4986 The glorious return of Comma McTraily
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-8685 Warn on deprecated case ctor
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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).
|
|\ \ \ \
| | | | |
| | | | | |
SI-10097 Error if no non-implicit case class param
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
For 2.12 migration, insert missing case class param section,
strip caseaccessor from implicit paramsection,
and deprecate the adaptation.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-9729 -Xmaxerrs to limit messages
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | | |
Since 2.7.2, console reporter has limited error messages to
a fixed 100. Use `-Xmaxerrs -Xmaxwarns` as from `javac` to configure.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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/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
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-3236 constant types for literal final static java fields
|
| | | | | | |
|
| | | | | | |
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-2712 Add support for higher order unification
|
| | | | | | |
|
| |/ / / / |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
test/files/pos/t3420.flags
versions.properties
|
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In refchecks, check that symbol with `@elidable` is a method.
When eliding in uncurry, doublecheck.
The check is enabled under `-Xsource:2.13`.
|
|\ \ \ \
| | | | |
| | | | | |
Remove deprecated -Y flags
|