| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |\
| | |
| | | |
Actually retract clashing synthetic apply/unapply
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also make this whole retraction of apply/unapply in case of a
clashing user-defined member conditional on `-Xsource:2.12`.
It turns out, as explained by lrytz, that the retraction mechanism
was fragile because it relied on the order in which completers are run.
We now cover both the case that:
- the completer was run, the `IS_ERROR` flag was set, and the
symbol was unlinked from its scope before `addSynthetics`
in `typedStat` iterates over the scope (since the symbol is
already unlinked, the tree is not added, irrespective of its flags).
For this case, we also remove the symbol from the synthetics in
its unit (for cleanliness).
- the completer is triggered during the iteration in `addSynthetics`,
which needs the check for the `IS_ERROR` flag during the iteration.
Before, the completer just unlinked the symbol and set the IS_ERROR flag,
and I assumed the typer dropped a synthetic tree with a symbol with
that flag, because the tree was not shown in -Xprint output.
In reality, the completer just always happened to run before the
addSynthetics loop and unlinked the symbol from its scope in the
test cases I came up with (including the 2.11 community build).
Thankfully, the 2.12 community build caught my mistake, and lrytz provided
a good analysis and review.
Fix scala/bug#10261
|
|\|
| |
| |
| | |
MathJax CDN update
|
| |
| |
| |
| | |
https://www.mathjax.org/cdn-shutting-down/
|
|\| |
|
| |
| |
| | |
Fix table
|
| | |
|
|\ \
| | |
| | | |
Actually retract clashing synthetic apply/unapply
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The completer set the IS_ERROR flag and I assumed the typer
dropped a synthetic tree with a symbol with that flag, because
the tree was not shown in -Xprint output.
It turns out, as explained by lrytz, that the mechanism was
fragile because it relied on the order in which completers are
run. We now cover both the case that:
- the completer was run (and the `IS_ERROR` flag was set)
before `addSynthetics` in `typedStat` iterates over the scope
(since the symbol is already unlinked, the tree is not added,
irrespective of its flags). For this case, we also remove the
symbol from the synthetics in its unit.
- the completer is triggered during the iteration in `addSynthetics`,
which needs the check for the `IS_ERROR` flag during the iteration.
Thankfully, the community build caught my mistake, and lrytz provided
a good analysis and review.
Fix scala/bug#10261
|
|\ \
| | |
| | | |
Revert some of ade53a123. Use completer factory methods.
|
|/ /
| |
| |
| |
| |
| |
| | |
Scalameta et al need to be able to customize the
type completer behavior, so we must use factory methods
to instantiate them, rather than instantiating the classes
directly.
|
|\ \
| | |
| | | |
SI-8040 Improve unused warnings
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Allow user-defined `[un]apply` in case companion
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Create named subclasses, preserve factory methods for external users.
Make explicit that TypeCompleterBase is not meant for wrapping.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
mkTypeCompleter is not suitable for wrapping
potentially polymorphic completers
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- remove logging wrapper that also does important work
- `assignAndEnterSymbol(tree)` --> `enterInScope(assignMemberSymbol(tree))`
- reduce redundant type test (we know it's an import/package/member)
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fixes the problem reported with #5730 by xuwei-k in scala/scala-dev#352.
The problem was already present before the introduction of
`applyUnapplyMethodCompleter`, as 63f7b35 (in #5294) introduced
a similar bug where the `PolyTypeCompleter`'s `typeParams` override
was masked.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
When matching user-defined apply/unapply members exist in a
case class's companion object, don't add clashing synthetic ones.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Don't emit a synthetic `apply` (or `unapply`) when it would
clash with an existing one. This allows e.g., a `private apply`,
along with a `case class` with a `private` constructor.
We have to retract the synthetic method in a pretty roundabout way,
as we need the other methods and the owner to be completed already.
Unless we have to complete the synthetic `apply` while completing
the user-defined one, this should not be a problem. If this does
happen, this implies there's a cycle in computing the user-defined
signature and the synthetic one, which is not allowed.
|
|\ \ \ \
| | | | |
| | | | | |
Consistify trailing punctuation in spec
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Also
- Consistify trailing punctuation
- Use whitespace to group linearization examples
|
|\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | | |
janekdb/topic/2.12.x-scaladoc-spelling-corrections-3
Fix Greek Mythology references in compiler package
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Improve documentation some packages and correct some typos in these directories,
- compiler
- library
|
|\ \ \ \
| | | | |
| | | | | |
SI-2458 Make spec example live test
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Synchronize the live test with the spec update,
which is trivial.
Also add a neg test showing that an imported name
remains ambiguous even if it resolves to the
definition in scope with which it is ambiguous.
|
|\ \ \ \
| | | | |
| | | | | |
Catch up with 2.11.x
|
| |\ \ \ \
| | | |_|/
| | |/| |
| | | | | |
Skip to 7fa3823 (2.11.x HEAD)
|
| | | | | |
|
| | |\ \ \
| | | | | |
| | | | | | |
`CompleterWrapper` delegates `typeParams`.
|
| | |/ / /
| | | | |
| | | | |
| | | | | |
Fixes the problem reported with #5730 by xuwei-k in scala/scala-dev#352.
|