summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools
Commit message (Collapse)AuthorAgeFilesLines
* 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-111-3/+10
| | | | | | | | | | | | 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-21/+27
| | | | | | | | 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-111-6/+4
| | | | | | Ignore bad name pos. Also delete unused val. Thanks, `-Ywarn-unused`!
* SI-8040 Warn unused parametersSom Snytt2017-03-112-42/+75
| | | | | | | | | | | | | | | | | | | | 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-116-16/+53
| | | | | | | | | | | | | | | | 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-8040 Heeding -Ywarn-unusedSom Snytt2017-03-114-9/+6
| | | | | | | 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-113-7/+22
| | | | | | | | | | | | 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-111-7/+26
| | | | | | | 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 #5675 from piyush-jaiswal/issue/9729som-snytt2017-03-101-2/+2
|\ | | | | Add tests for ConsoleReporter.
| * Add tests for ConsoleReporter.piyush-jaiswal2017-03-111-2/+2
| |
* | Merge pull request #5761 from lrytz/sd329Adriaan Moors2017-03-101-5/+13
|\ \ | |/ |/| Don't use `equals` for comparing java.lang.Double/Float
| * Don't use `equals` for comparing java.lang.Double/FloatLukas Rytz2017-03-091-5/+13
| | | | | | | | | | | | | | 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`.
* | new version numbers for snapshot and integration builds, new repositoryLukas Rytz2017-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #5671 from retronym/topic/stubby-2Lukas Rytz2017-03-032-5/+7
|\ \ | | | | | | Avoid compiler crash with missing transitive dependencies
| * | Avoid forcing info transforms of primitive methodsJason Zaugg2017-02-192-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #5622 from edmundnoble/extra-errsAdriaan Moors2017-03-023-24/+46
|\ \ \ | |_|/ |/| | Improved error messages for identically named, differently prefixed types
| * | Match error lengthsEdmund Noble2017-02-071-2/+5
| | |
| * | Improved error messages for identically named, differently prefixed typesEdmund Noble2016-12-313-24/+43
| | |
* | | SI-10207 Error before update conversionSom Snytt2017-02-261-5/+6
| | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #5723 from dragos/issue/regression-assert-ideLukas Rytz2017-02-241-5/+10
|\ \ \ | | | | | | | | Fix regression introduced by 5751763
| * | | Fix regression in 5751763Iulian Dragos2017-02-221-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Revert "Fix erasure of the qualifier of ##"Adriaan Moors2017-02-221-7/+6
| | | |
* | | | Revert "SI-10133 Require escaped single quote char lit"Adriaan Moors2017-02-211-18/+6
| | | |
* | | | Merge pull request #5658 from retronym/topic/hashhashLukas Rytz2017-02-211-6/+7
|\ \ \ \ | | | | | | | | | | Fix erasure of the qualifier of ##
| * | | | Fix erasure of the qualifier of ##Jason Zaugg2017-01-241-6/+7
| | |/ / | |/| |
* | | | Merge pull request #5708 from szeiger/issue/si10194Lukas Rytz2017-02-211-7/+7
|\ \ \ \ | | | | | | | | | | SI-10194: Fix abstract type resolution for overloaded HOFs
| * | | | SI-10194: Fix abstract type resolution for overloaded HOFsStefan Zeiger2017-02-211-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | | | Merge pull request #5700 from retronym/ticket/10154-refactorLukas Rytz2017-02-212-20/+29
|\ \ \ \ \ | | | | | | | | | | | | Refactor lookupCompanion
| * | | | | Refactor implementation of lookupCompanionJason Zaugg2017-02-192-20/+29
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | - Check for module class up front to use sourceModule - Consolidate most of the logic in Contexts
* | | | | Merge pull request #5704 from som-snytt/issue/10190-elide-stringLukas Rytz2017-02-211-2/+6
|\ \ \ \ \ | | | | | | | | | | | | SI-10190 Elide string to empty instead of null
| * | | | | SI-10190 Elide string to empty instead of nullSom Snytt2017-02-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #5640 from optimizely/repl-import-handlerAdriaan Moors2017-02-201-2/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-9881 Fix ImportHandler's reporting of importedNames and importedSymbols
| * | | | | | Fix ImportHandler's reporting of importedNames and importedSymbolsHao Xia2017-01-111-2/+5
| | |_|_|/ / | |/| | | |
* | | | | | Merge pull request #5629 from som-snytt/issue/10120-quote-errAdriaan Moors2017-02-201-6/+18
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | SI-10133 Require escaped single quote char lit
| * | | | | SI-10120 Extra advice on unclosed char literalSom Snytt2017-01-081-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-081-0/+5
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | The spec specifically requires `'\''` and not `'''`. The error consumes all consecutive single quotes.
* | | | | Merge pull request #5711 from retronym/ticket/jrtLukas Rytz2017-02-202-30/+58
|\ \ \ \ \ | | | | | | | | | | | | Faster and simpler Java 9 classpath implementation
| * | | | | Faster and simpler Java 9 classpath implementationJason Zaugg2017-02-172-30/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* | | | | | Merge pull request #5714 from dragos/issue/usage-sterr-SI-10178Lukas Rytz2017-02-201-2/+10
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-10178 Route reporter.echo to stdout
| * | | | | | SI-10178 Route reporter.echo to stdoutIulian Dragos2017-02-181-2/+10
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | `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.
* | | | | | SI-10148 Accept verbose zeroSom Snytt2017-02-181-4/+4
| |_|_|_|/ |/| | | | | | | | | | | | | | The test for non-zero must recognize `-0e+00f` and variants.
* | | | | Merge branch '2.12.x' into merge-2.11.x-to-2.12.x-20170214Seth Tisue2017-02-1736-98/+122
|\| | | |
| * | | | Merge pull request #5694 from ↵Seth Tisue2017-02-1630-48/+49
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | janekdb/topic/2.12.x-scaladoc-spelling-corrections-2 Fix typos in compiler and reflect
| | * | | | Fix typos in compiler and reflectJanek Bogucki2017-02-1330-48/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Miscellania: Miscellania is a small island off the northernmost part of the Fremennik Isles - RunScape Wiki Miscellanea: A collection of miscellaneous objects or writings - Merriam-Webster
| * | | | | Merge pull request #5648 from som-snytt/issue/10148Seth Tisue2017-02-162-8/+30
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-10148 Follow Java for float literals
| | * | | | | SI-10148 Follow Java for float literalsSom Snytt2017-01-182-8/+30
| | | |_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | 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-161-32/+24
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-9636 More precise error pos on apply inference
| | * | | | | SI-9636 More precise error pos on apply inferenceSom Snytt2016-12-201-32/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-161-1/+1
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-9675 warn about non-sensible equals in anonymous functions