summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5851 from adriaanm/2.12-catchup-2.11HEAD2.12.xSeth Tisue2017-04-131-1/+1
|\ | | | | Merge 2.11.x into 2.12.x [ci: last-only]
| * No-op merge 2.11.x into 2.12.xAdriaan Moors2017-04-130-0/+0
| |\
| | * Merge pull request #5846 from adriaanm/t10261-2.11Adriaan Moors2017-04-138-3/+42
| | |\ | | | | | | | | Actually retract clashing synthetic apply/unapply
| | | * Actually retract clashing synthetic apply/unapply [backport]Adriaan Moors2017-04-128-3/+42
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Merge 2.11.x into 2.12.xAdriaan Moors2017-04-131-1/+1
| |\| | | | | | | | | | MathJax CDN update
| | * MathJax CDN change and version bumpAdriaan Moors2017-04-101-1/+1
| | | | | | | | | | | | https://www.mathjax.org/cdn-shutting-down/
| * | No-op merge 2.11.x into 2.12.xAdriaan Moors2017-04-130-0/+0
|/| | | |/
| * Update README.mdAdriaan Moors2017-04-101-1/+1
| | | | | | Fix table
| * Bump on 2.11.10 releaseAdriaan Moors2017-04-105-6/+6
| |
* | Merge pull request #5845 from adriaanm/t10261Adriaan Moors2017-04-124-1/+31
|\ \ | | | | | | Actually retract clashing synthetic apply/unapply
| * | Actually retract clashing synthetic apply/unapplyAdriaan Moors2017-04-124-1/+31
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #5844 from adriaanm/rework-5816Seth Tisue2017-04-112-21/+22
|\ \ | | | | | | Revert some of ade53a123. Use completer factory methods.
| * | Revert some of ade53a123. Use completer factory methods.Adriaan Moors2017-04-112-21/+22
|/ / | | | | | | | | | | | | 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.
* | Merge pull request #5402 from som-snytt/issue/8040-unusedSeth Tisue2017-04-1048-129/+737
|\ \ | | | | | | SI-8040 Improve unused warnings
| * | SD-363 Xlint no warn deprecated params, defaultsSom Snytt2017-04-062-4/+15
| | | | | | | | | | | | | | | | | | | | | Deprecation is an escape hatch for unused params. Since default arg getters receive values of previous args, don't warn when they are unused.
| * | SI-8040 Defer deprecation of -Ywarn-unused-importsSom Snytt2017-04-061-1/+1
| | | | | | | | | | | | So as not to complicate established builds in the wild.
| * | SI-8040 Retreat on paramsSom Snytt2017-04-061-2/+5
| | | | | | | | | | | | | | | | | | Don't warn unused params when `-Xlint`. Don't disable under lint, so `-Ywarn-unused -Xlint` works.
| * | SI-8040 No warn DummyImplicitSom Snytt2017-03-112-1/+4
| | | | | | | | | | | | It's just a dummy.
| * | SI-8040 Xlint enables unused warningsSom Snytt2017-03-1115-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `-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-118-23/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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-8040 Avoid Null companionSom Snytt2017-03-111-2/+2
| | | | | | | | | | | | | | | | | | Don't warn on the private constructor of an abstract class. Instead, take it as a signal that the class must not be instantiated.
| * | SI-7860 No warn private implicit value classSom Snytt2017-03-116-4/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-114-23/+51
| | | | | | | | | | | | | | | | | | | | | | | | 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-114-7/+27
| | | | | | | | | | | | | | | | | | Ignore bad name pos. Also delete unused val. Thanks, `-Ywarn-unused`!
| * | SI-8040 Warn unused parametersSom Snytt2017-03-1112-46/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1112-20/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-113-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Heeding -Ywarn-unusedSom Snytt2017-03-115-10/+8
| | | | | | | | | | | | | | | | | | | | | Polish notation, as in shoe-shine, as recommended by the warning. Minor clean-ups as advocated by `Ywarn-unused` and `Xlint`.
| * | SI-8040 Warn unused pattern varsSom Snytt2017-03-118-10/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-113-28/+101
| | | | | | | | | | | | | | | | | | | | | 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 #5816 from adriaanm/userdefined-apply-212Adriaan Moors2017-04-1010-213/+451
|\ \ \ | | | | | | | | Allow user-defined `[un]apply` in case companion
| * | | Boy scout mkTypeCompleterAdriaan Moors2017-04-062-118/+143
| | | | | | | | | | | | | | | | | | | | Create named subclasses, preserve factory methods for external users. Make explicit that TypeCompleterBase is not meant for wrapping.
| * | | Use CompleterWrapper for implicitFactoryMethodCompleterAdriaan Moors2017-04-062-7/+8
| | | | | | | | | | | | | | | | | | | | mkTypeCompleter is not suitable for wrapping potentially polymorphic completers
| * | | Clean up copyMethodCompleter, capture lessAdriaan Moors2017-04-061-8/+8
| | | |
| * | | Refactor to reduce assignSymbol indirectionAdriaan Moors2017-04-063-55/+37
| | | | | | | | | | | | | | | | | | | | | | | | - 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)
| * | | Create scope only onceAdriaan Moors2017-04-061-6/+7
| | | |
| * | | `CompleterWrapper` delegates `typeParams`.Adriaan Moors2017-04-062-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Improvements based on reviews by Lukas & JasonAdriaan Moors2017-04-066-24/+107
| | | |
| * | | Clarify spec of interaction of existing vs synthetic apply/unapplyAdriaan Moors2017-04-061-11/+10
| | | | | | | | | | | | | | | | | | | | When matching user-defined apply/unapply members exist in a case class's companion object, don't add clashing synthetic ones.
| * | | Allow user-defined `[un]apply` in case companionAdriaan Moors2017-04-054-24/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #5801 from janekdb/topic/2.12/spec-trailing-punctuationSeth Tisue2017-04-104-10/+15
|\ \ \ \ | | | | | | | | | | Consistify trailing punctuation in spec
| * | | | Fix == in spec linearization examplesJanek Bogucki2017-04-104-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also - Consistify trailing punctuation - Use whitespace to group linearization examples
* | | | | Merge pull request #5786 from ↵Seth Tisue2017-04-1015-24/+24
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | janekdb/topic/2.12.x-scaladoc-spelling-corrections-3 Fix Greek Mythology references in compiler package
| * | | | Fix Greek Mythology references in compiler packageJanek Bogucki2017-04-1015-24/+24
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | Improve documentation some packages and correct some typos in these directories, - compiler - library
* | | | Merge pull request #5838 from som-snytt/issue/2458Lukas Rytz2017-04-105-33/+58
|\ \ \ \ | | | | | | | | | | SI-2458 Make spec example live test
| * | | | SI-2458 Make spec example live testSom Snytt2017-04-095-33/+58
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #5837 from adriaanm/merge-2.11.x-into-2.12.xAdriaan Moors2017-04-0819-653/+78
|\ \ \ \ | | | | | | | | | | Catch up with 2.11.x
| * \ \ \ Merge 2.11.x into 2.12.xAdriaan Moors2017-04-070-0/+0
| |\ \ \ \ | | | |_|/ | | |/| | | | | | | Skip to 7fa3823 (2.11.x HEAD)
| | * | | Bye bye JIRAAdriaan Moors2017-04-071-2/+1
| | | | |
| | * | | Merge pull request #5828 from adriaanm/userdefined-apply-352Adriaan Moors2017-04-052-0/+16
| | |\ \ \ | | | | | | | | | | | | `CompleterWrapper` delegates `typeParams`.