| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Deprecation is an escape hatch for unused params.
Since default arg getters receive values of previous
args, don't warn when they are unused.
|
|
|
|
| |
So as not to complicate established builds in the wild.
|
|
|
|
|
|
| |
Don't warn unused params when `-Xlint`.
Don't disable under lint, so `-Ywarn-unused -Xlint` works.
|
|
|
|
| |
It's just a dummy.
|
|
|
|
|
|
|
|
|
|
|
|
| |
`-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$.
|
|
|
|
|
|
| |
Don't warn on the private constructor of an abstract
class. Instead, take it as a signal that the class must
not be instantiated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Polish notation, as in shoe-shine, as recommended by
the warning.
Minor clean-ups as advocated by `Ywarn-unused` and `Xlint`.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Add tests for ConsoleReporter.
|
| | |
|
|\ \
| |/
|/| |
Don't use `equals` for comparing java.lang.Double/Float
|
| |
| |
| |
| |
| |
| |
| | |
Fixes https://github.com/scala/scala-dev/issues/329
The `equals` method for java.lang.Double/Float behaves differently than comparing
the `doubleValue`s / `floatValues` for `-0.0`/`0.0`/`NaN`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Integration builds now have version number like `2.12.2-bin-sha7` or `2.13.0-pre-sha7`
and are published to scala-integration (no longer scala-release-temp).
scala-release-temp is still used in the bootstrap script for publishing intermediate
artifacts (starr, locker).
Various cleanups in the scripts.
|
|\ \
| | |
| | | |
Avoid compiler crash with missing transitive dependencies
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Although this is cheap, when debugging log output of info
transformer activity this was a major source of noise.
This commit avoids the info lookup for methods other
than `+`, and then for `+` uses the typer phase info
to distinguish concatentation from addition.
|
|\ \ \
| |_|/
|/| | |
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.
|
|\ \ \
| | | |
| | | | |
Fix regression introduced by 5751763
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
enterClass/Module may return an existing symbol, but in 5751763 the return value was dropped leading to assertion failures. This may show up only in the presentation compiler, which explains why it went unnoticed.
Here's what needs to happen:
- a class with a companion is loaded by the IDE, but the class name is different than the file name. This is from source
- the same class and companion object exist as binary, and are loaded from classfiles when the package is completed (since they have different names than the source file, the classpath abstraction will only "know" that there is a classfile, and no corresponding source file)
It seems that companionClass always prefers to return the companion defined in a source file, but if this assertion is called from the code path that tries to load the binary version, the newly created module will not match.
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix erasure of the qualifier of ##
|
| | |/ /
| |/| | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-10194: Fix abstract type resolution for overloaded HOFs
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Types in the applicable overload alternatives need to be seen from
the respective owners of the individual alternative, not from the
target’s owner (which can be a subtype of the types that define the
methods).
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Refactor lookupCompanion
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | | |
- Check for module class up front to use sourceModule
- Consolidate most of the logic in Contexts
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-10190 Elide string to empty instead of null
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Avoid NPE when eliding string-valued functions.
For example, `log(s"$cheap$expensive")` needn't print null.
This is a natural and inexpensive way to elide strings.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-9881 Fix ImportHandler's reporting of importedNames and importedSymbols
|
| | |_|_|/ /
| |/| | | | |
|
|\ \ \ \ \ \
| |_|_|_|_|/
|/| | | | | |
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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Faster and simpler Java 9 classpath implementation
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Take advantage of the `/packages` index provided by the
jrt file system to avoid (expensive) Files.exist for
non-existent entries across the full list of modules.
- Extends ClassPath directly which leads to a simpler
implemnentation that using the base class.
- Add a unit test that shows we can read classes and packages
from the Java standard library.
Fixes scala/scala-dev#306
With this change bootstrap time under Java 9 was comparable to
Java 8. Before, it was about 40% slower.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-10178 Route reporter.echo to stdout
|
| | |_|_|_|/
| |/| | | |
| | | | | |
| | | | | |
| | | | | | |
`echo` is currently used only for usage information, and that makes a lot more sense to
go to stdout instead of stderr. This allows grepping through the extensive list of
compiler options.
|
| |_|_|_|/
|/| | | |
| | | | |
| | | | | |
The test for non-zero must recognize `-0e+00f` and variants.
|
|\| | | | |
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
janekdb/topic/2.12.x-scaladoc-spelling-corrections-2
Fix typos in compiler and reflect
|