summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | SI-8525 Clarify usage of -Xlint:_,flagSom Snytt2014-07-166-98/+77
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also clarify usage of -Xlint flag. Align more with javac -Xlint:all,-flag,flag where once a flag is explicitly enabled it cannot be disabled, but where the wildcard is a backstop only. (There is no all option yet here.) -Xlint and -Xlint:_ just set a flag which is consulted by any unset lint warning. Xlint warnings consult the state of Xlint when they are unset. Individual -Ywarn-ings do not. Other warnings are explicitly set to false. They can only be enabled programmatically. Some tests are corrected. Also, option order is no longer significant, see the unit test.
* | | Merge pull request #3792 from som-snytt/issue/8525Lukas Rytz2014-07-1628-75/+318
|\ \ \ | | | | | | | | SI-8525 -Xlint:nowarn-missing-interpolator
| * | | SI-8525 No anonymous lintSom Snytt2014-07-1016-40/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn anonymous references to `settings.lint` into named settings. After that, trust to Adriaan to make them filterable. There are a few remaining top-level -Y lint warnings that are deprecated.
| * | | SI-8525 Add -Xlint:-warn-missing-interpolatorSom Snytt2014-07-0814-59/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn off lint warnings with negating prefix, and add a lint-only warning for the infamously nagging "Did you forget the interpolator?" That message is made more dignified. Without `-Xlint:false`, there is no mechanism to turn off anonymous linters once `-Xlint` is selected.
| * | | SI-8616 Error on -deprecation:true,falseSom Snytt2014-07-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an error, not a crash. Alternatively, one could define the multivalued colon case as equivalent to specifying the option multiple times. That would be very regular. But sometimes it's nicer just to error out.
| * | | SI-8610 -Xlint is multichoice optionSom Snytt2014-07-0812-20/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make -Xlint a "multichoice" option for purposes of option parsing. This allows turning on "lint with these warnings" instead of only "turn off these warnings but enable other lint warnings". ``` $ scalac -Xlint:warn-adapted-args linty.scala # lint plus a warning $ scalac -Xlint warn-adapted-args linty.scala # same $ scalac -Xlint linty.scala # same as now $ scalac -Xlint -- linty.scala # ok, not necessary $ scalac -Xlint _ -- linty.scala # another funky underscore ``` This would also enable Xlint options that are not standalone options, although that is not implemented in this commit. For example, `-Xlint:no-missing-interpolator` could be used to disable that warning. (There is no `-Xoption:flavor=off` syntax.) (`no-` switches would not be enabled by `_`.)
* | | | Merge pull request #3883 from gourlaysama/wip/t8557Vlad Ureche2014-07-154-2/+35
|\ \ \ \ | | | | | | | | | | SI-8557 make scaladoc normalize paths of external jars.
| * | | | SI-8557 make scaladoc normalize paths of external jars.Antoine Gourlay2014-07-154-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scaladoc compares (string representations of) the paths from -doc-external-doc and the paths form `sym.underlyingSource`. We now normalize on both ends before comparing them.
* | | | | Merge pull request #3817 from phaller/topic/typetagsLukas Rytz2014-07-1510-35/+99
|\ \ \ \ \ | | | | | | | | | | | | SI-5919 TypeTags and Exprs should be serializable
| * | | | | Add SerialVersionUID to SerializedTypeTag and SerializedExprPhilipp Haller2014-07-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason for adding the SerialVersionUID annotations is to be able to provide serialization stability throughout the 2.11.x series. And since type tags (and exprs) have not been serializable before, this does not break serialization for existing code.
| * | | | | SI-5919 TypeTags and Exprs should be serializablePhilipp Haller2014-07-1510-35/+99
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make TypeCreator and TreeCreator extend Serializable. - When replacing a SerializedTypeTag with a TypeTag or WeakTypeTag, do not use scala.reflect.runtime.universe.rootMirror, since it is unlikely to find user classes; instead, create a runtime mirror using the context ClassLoader of the current thread. Use the same logic for SerializedExpr. - Remove writeObject/readObject methods from SerializedTypeTag and SerializedExpr since they are unused. - Add @throws annotation on writeReplace and readResolve methods. - Handle SecurityException if the current thread cannot access the context ClassLoader. - To make type tags of primitive value classes serializable, make PredefTypeCreator a top-level class. Otherwise, it would retain a reference to the enclosing Universe, rendering the TypeCreator non-serializable. Binary compatibility: - Keep nested PredefTypeCreator class to avoid backward binary incompatible change. - Keep `var` modifiers on the class parameters of SerializedTypeTag for backward binary compatibility. - Adds filter rules to forward binary compatibility whitelist: - `TypeCreator`, `PredefTypeCreator`, and `TreeCreator` must now extend from `Serializable`. - Must have new class `scala.reflect.api.PredefTypeCreator` to avoid problematic outer reference.
* | | | | Merge pull request #3858 from densh/si/8703Jason Zaugg2014-07-153-5/+19
|\ \ \ \ \ | | | | | | | | | | | | SI-8703 add support for blocks with just a single expression to quasiquotes
| * | | | | Address pull request feedbackDenys Shabalin2014-07-141-1/+3
| | | | | |
| * | | | | SI-8703 add support for blocks with just a single expression to quasiquotesDenys Shabalin2014-07-023-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it was impossible to match a block that was constructed as Block(Nil, term) Due to the fact that quasiquotes always flatten those into just term. This is a correct behaviour for construction (for sake of consistency with parser) but doing it in deconstruction mode make it impossible to match such blocks which could have been constructed manually somewhere. To fix this we just disable block flattening in deconstruction mode. Interestingly enough this doesn't break existing code due to the fact that quasiquote's block matcher also matches expressions as single-element blocks. This allows to match single-element blocks with patterns like q"{ $foo }".
* | | | | | Merge pull request #3882 from adriaanm/jline-2.12Lukas Rytz2014-07-152-2/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Bump jline version to 2.12 (Re: SI-8535)
| * | | | | | Bump jline version to 2.12 (Re: SI-8535)Adriaan Moors2014-07-152-2/+1
| | |/ / / / | |/| | | | | | | | | | | | | | | | Move version info where it belongs: versions.properties
* | | | | | Merge pull request #3845 from xeno-by/topic/attachment-subclassingJason Zaugg2014-07-154-1/+23
|\ \ \ \ \ \ | | | | | | | | | | | | | | relaxes attachment-matching rules
| * | | | | | relaxes attachment-matching rulesEugene Burmako2014-07-104-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It came as a surprise recently, but attachments.contains/get/update/remove require the class of the payload to match the provided tag exactly, not taking subclassing into account. This commit fixes the oversight.
* | | | | | | Merge pull request #3844 from xeno-by/topic/rangepos-subpatternsJason Zaugg2014-07-155-1/+26
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | prevents c.internal.subpatterns from destroying rangeposes
| * | | | | | prevents some reflection APIs from destroying rangeposesEugene Burmako2014-07-105-1/+26
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit continues the work started in fcb3932b32. As we've figured out the hard way, exposing internally maintained trees (e.g. macro application) to the user is dangerous, because they can mutate the trees in place using one of the public APIs, potentially corrupting our internal state. Therefore, at some point we started duplicating everything that comes from the user and goes back to the user. This was generally a good idea due to the reason described above, but there was a problem that we didn't foresee - the problem of corrupted positions. It turns out that Tree.duplicate focuses positions in the tree being processed, turning range positions into offset ones, and that makes it impossible for macro users to make use of precise position information. I also went through the calls to Tree.duplicate to see what can be done to them. In cases when corruptions could happen, I tried to replace duplicate with duplicateAndKeepPositions. Some notes: 1) Tree rehashing performed in TreeGen uses duplicates here and there (e.g. in mkTemplate or in mkFor), which means that if one deconstructs a macro argument and then constructs it back, some of the positions in synthetic trees might become inaccurate. That's a general problem with synthetic trees though, so I don't think it should be addressed here. 2) TypeTree.copyAttrs does duplication of originals, which means that even duplicateAndKeepPositions will adversely affect positions of certain publicly accessible parts of type trees. I'm really scared to change this though, because who knows who can use this invariant. 3) Some methods that can be reached from the public API (Tree.substituteXXX, c.reifyXXX, c.untypecheck, ...) do duplicate internally, but that shouldn't be a big problem for us, because nothing is irreversibly corrupted here. It's the user's choice to call those methods (unlike with TypeTree.copyAttrs) and, if necessary, they can fixup the positions themselves afterwards. 4) Macro engine internals (macro impl binding creation, exploratory typechecking in typedMacroBody) use duplicate, but these aren't supposed to be seen by the user, so this shouldn't be a problem. 5) Certain parser functions, member syntheses and typer desugarings also duplicate, but in those cases we aren't talking about taking user trees and screwing them up, but rather about emitting potentially imprecise positions in the first place. Hence this commit isn't the right place to address these potential issues.
* | | | | | Merge pull request #3872 from lrytz/no-adapted-argsLukas Rytz2014-07-155-11/+40
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix -Yno-adapted-args, it would just warn, not err
| * | | | | | Fix -Yno-adapted-args, it would just warn, not errLukas Rytz2014-07-155-11/+40
| | | | | | |
* | | | | | | Merge pull request #3878 from som-snytt/issue/8608Lukas Rytz2014-07-154-4/+34
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8608 f interpolator emits constant strings
| * | | | | | | SI-8608 f-interpolator inlines StringOpsSom Snytt2014-07-141-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of "hi".format(), emit new _root_.s.c.i.StringOps("hi").format(), to clarify intent and avoid picking up some other implicit enhancement. A further optimization would be to use String.format directly when that is possible. The ticket says it is not possible for ``` f"${BigDecimal(3.4)}%e" ```
| * | | | | | | SI-8608 f interpolator emits constant stringsSom Snytt2014-07-144-2/+24
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When invoking `format` is obviated by a lack of formatting fields, then just degenerate to an unenhanced constant string. This means it doesn't cost anything to use f"$$ordinary" in place of "$ordinary", which may cause warnings under -Xlint. Note that certain format literals, in particular for line separator %n, are not actually literals and can't be replaced at compile time.
* | | | | | | Merge pull request #3871 from lrytz/t8117Lukas Rytz2014-07-143-11/+35
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8117 Fix bug when mixing well-positioned named and positional args
| * | | | | | | SI-8117 Fix bug when mixing well-positioned named and positional argsLukas Rytz2014-07-113-11/+35
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method `missingParams` which returns undefined parameters of a given invocation expression still assumed that named arguments can only appear after positional ones.
* | | | | | | Merge pull request #3874 from phaller/issue/8590Lukas Rytz2014-07-141-12/+60
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | SI-8590 Expand doc comments for ExecutionContext
| * | | | | | SI-8590 Expand doc comments for ExecutionContextPhilipp Haller2014-07-141-12/+60
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - link to Java API docs for ForkJoinPool-based default implementation - add example for creating an execution context from a `java.util.concurrent.ExecutorService` - add tags for parameters and return values - expand doc comment for `prepare`
* | | | | | Merge pull request #3867 from lrytz/t8708Lukas Rytz2014-07-0911-6/+122
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8708 Fix pickling of LOCAL_CHILD child of sealed classes
| * | | | | | SI-8708 Fix pickling of LOCAL_CHILD child of sealed classesLukas Rytz2014-07-0711-6/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a sealed class or trait has local children, they are not pickled in as part of the children of the symbol (introduced in 12a2b3b to fix Aladdin bug 1055). Instead the compiler adds a single child class named LOCAL_CHILD. The parents of its ClassInfoType were wrong: the first parent should be a class. For sealed traits, we were using the trait itself. Also, the LOCAL_CHILD dummy class was entered as a member of its enclosing class, which is wrong: it represents a local (non-member) class, and it's a synthetic dummy anyway.
* | | | | | | Merge pull request #3866 from Blaisorblade/issue/8677-backportLukas Rytz2014-07-092-1/+6
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | SI-8677 Duration: Zero - Inf should be MinusInf
| * | | | | | [backport] SI-8677 Duration: Zero - Inf should be MinusInfPaolo G. Giarrusso2014-07-042-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #8677. Add basic tests. This is a backport from 2.12.x of dead39dc5f21c6eac41788e93426c50ddd398c24.
* | | | | | | Merge pull request #3868 from adriaanm/report-filterAdriaan Moors2014-07-081-0/+13
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Restore reporter forwarders in CompilationUnit
| * | | | | | | Restore reporter forwarders in CompilationUnitAdriaan Moors2014-07-081-0/+13
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate them so that we can remove them in a couple of 2.11.x releases. Plenty of plugins were probably using `unit.error` et al. The continuations plugin was, for one (remedying this with pending PR).
* | | | | | | Merge pull request #3820 from adriaanm/report-filterAdriaan Moors2014-07-0686-469/+651
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | refactor error/warning reporting
| * | | | | | | Use countElementsAsString for summarized warnings.Adriaan Moors2014-07-0420-23/+23
| | | | | | | |
| * | | | | | | Encapsulate deprecation warning message synthesis.Adriaan Moors2014-07-044-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both refchecks and typer constructed the same message. But different. Now with more DRYness. Note that no check files had to be updated (disconcerting)...
| * | | | | | | Remove deprecationWarning, currentReporting from ReportingAdriaan Moors2014-07-047-33/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves us a bit closer to the goal of having a single entry point to reporting. Must modularize Reporting a bit so it can be used in Variances (need a reference to `currentRun` in `reflect.internal.Reporting`).
| * | | | | | | Rip out reporting indirection from CompilationUnitAdriaan Moors2014-07-0444-175/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inline the forwarders from CompilationUnit, which should not affect behavior. Since all forwarders lead to global.reporter, don't first navigate to a compilation unit, only to then forward back to global.reporter. The cleanup in the previous commits revealed a ton of confusion regarding how to report an error. This was a mechanical search/replace, which has low potential for messing things up, since the list of available methods are disjoint between `reporter` and `currentRun.reporting`. The changes involving `typer.context` were done previously. Essentially, there are three ways to report: - via typer.context, so that reporting can be silenced (buffered) - via global.currentRun.reporting, which summarizes (e.g., deprecation) - via global.reporter, which is (mostly) stateless and straightforward. Ideally, these should all just go through `global.currentRun.reporting`, with the typing context changing that reporter to buffer where necessary. After the refactor, these are the ways in which we report (outside of typer): - reporter.comment - reporter.echo - reporter.error - reporter.warning - currentRun.reporting.deprecationWarning - currentRun.reporting.incompleteHandled - currentRun.reporting.incompleteInputError - currentRun.reporting.inlinerWarning - currentRun.reporting.uncheckedWarning Before: - c.cunit.error - c.enclosingUnit.deprecationWarning - context.unit.error - context.unit.warning - csymCompUnit.warning - cunit.error - cunit.warning - currentClass.cunit.warning - currentIClazz.cunit.inlinerWarning - currentRun.currentUnit.error - currentRun.reporting - currentUnit.deprecationWarning - currentUnit.error - currentUnit.warning - getContext.unit.warning - getCurrentCUnit.error - global.currentUnit.uncheckedWarning - global.currentUnit.warning - global.reporter - icls.cunit.warning - item.cunit.warning - reporter.comment - reporter.echo - reporter.error - reporter.warning - reporting.deprecationWarning - reporting.incompleteHandled - reporting.incompleteInputError - reporting.inlinerWarning - reporting.uncheckedWarning - typer.context.unit.warning - unit.deprecationWarning - unit.echo - unit.error - unit.incompleteHandled - unit.incompleteInputError - unit.uncheckedWarning - unit.warning - v1.cunit.warning All these methods ended up calling a method on `global.reporter` or on `global.currentRun.reporting` (their interfaces are disjoint). Also clean up `TypeDiagnostics`: inline nearly-single-use private methods.
| * | | | | | | Route type checker reporting through contextAdriaan Moors2014-07-044-28/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continue the work started in SI-8450 (no "implicit numeric widening" warning in silent mode), which was caused by going straight to the reporter instead of using the context for type error reporting (which buffers in silent mode). Ideally, this mistake should not be possible: typer should change the current reporter to buffer where appropriate.
| * | | | | | | Track symbol that caused a deprecation warning.Adriaan Moors2014-07-048-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that we can filter deprecations based on defining package. Configurable error reporting will support a rule like: "In compilation unit X, escalate deprecation warnings that result from accessing members in package P that have been deprecated since version V. Report an error instead of a warning for those." TODO: remove deprecationWarning overload that doesn't take a `Symbol`? (Replace by a default value of `NoSymbol` for the deprecated symbol arg?)
| * | | | | | | Uniformly route reporting through reporter.Adriaan Moors2014-07-047-58/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sharpen interfaces, reduce footprint of Reporting trait. Ideally, all reporting should indirect through reporter, and the `Reporting` trait itself should be restricted to a single method that retrieves the current `reporter`. Pull up some more reporting to reflect.internal. Would like to do more, but need to move partest to the reflect.internal interface first. (Its `errorCount` relies on `ERROR.count` in `tools.nsc.Reporter`.)
| * | | | | | | Move reporting logic into Reporting traitAdriaan Moors2014-07-0420-193/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move code from Global/SymbolTable to separate Reporting traits to start carving out an interface in scala.reflect.internal.Reporting, with internals in scala.tools.nsc. Reporting is mixed into the cake. It contains a nested class PerRunReporting. Should do the same for debugging/logging. The idea is that CompilationUnit and Global forward all reporting to Reporter. The Reporting trait contains these forwarders, and PerRunReporting, which accumulates warning state during a run. In the process, I slightly changed the behavior of `globalError` in reflect.internal.SymbolTable: it used to abort, weirdly. I assume that was dummy behavior to avoid introducing an abstract method. It's immediately overridden in Global, and I couldn't find any other subclasses, so I don't think the behavior in SymbolTable was ever observed. Provide necessary hooks for scala.reflect.macros.Parsers#parse. See scala/reflect/macros/contexts/Parsers.scala's parse method, which overrides the reporter to detect when parsing goes wrong. This should be refactored, but that goes beyond the scope of this PR. Don't pop empty macro context stack. (Ran into this while reworking -Xfatal-warnings logic.) Fix -Xfatal-warnings behavior (and check files): it wasn't meant to influence warning reporting, except for emitting one final error; if necessary to fail the compile (when warnings but no errors were reported). Warnings should stay warnings. This was refactored in fbbbb22946, but we soon seem to have relapsed. An hour of gitfu did not lead to where it went wrong. Must've been a merge.
| * | | | | | | Pure refactor: reorder definitionsAdriaan Moors2014-07-041-23/+32
| | | | | | | |
| * | | | | | | Unclutter Reporter. Move truncation to ReplReporter.Adriaan Moors2014-07-0411-62/+77
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor to reduce the Reporter interface. Working towards minimal interfaces in scala.reflect.internal that can be consumed by sbt/IDE/.... The scala.tools.nsc package is entirely private to the compiler (in principle). A `Reporter` should only be used to inform (info/warning/error). No state. Ideally, we'd move to having only one reporter, whose lifetime is adjusted appropriately (from per-run in general to per-context for type checking, so errors can be buffered -- "silenced" -- during nested type checking calls). Start the clean up by moving truncation to the REPL, since it's not relevant for regular reporting. Perversely, we were checking truncation all the time, even though it's only on during a repl run. (Truncation is now always turned off in the repl under -verbose.) Untangle error resetting on symbols from error reporting (reportAdditionalErrors). This fixes a nice&subtle bug that caused feature warnings to be suppressed under `-Xfatal-warnings`: ``` def reportCompileErrors() { if (!reporter.hasErrors && reporter.hasWarnings && settings.fatalWarnings) globalError("No warnings can be incurred under -Xfatal-warnings.") if (reporter.hasErrors) { ... } else { // will erroneously not get here if // `reporter.hasWarnings && settings.fatalWarnings` // since the `globalError` call above means `reporter.hasErrors`... allConditionalWarnings foreach (_.summarize()) ... } } ``` The second `if`'s condition depends on the `globalError` call in the first `if`...
* | | | | | | Merge pull request #3842 from Ichoran/issue/8335Adriaan Moors2014-07-041-4/+2
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | SI-8335 List.++ avoidably burns memory
| * | | | | | SI-8335 List.++ avoidably burns memoryRex Kerr2014-06-271-4/+2
| | |/ / / / | |/| | | | | | | | | | | | | | | | Changed to check the identity of the CanBuildFrom instead of the identity of the generated builder to shortcut building. Should reduce memory churn on ++ a little.
* | | | | | Merge pull request #3788 from som-snytt/issue/8494Adriaan Moors2014-07-041-40/+56
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8494 Restore filtering javap output
| * | | | | | SI-8494 Javap filter includes specializedSom Snytt2014-05-231-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When filtering javap output, include specialized versions of methods. For anonfuns, in particular, the apply$sp is the method of interest.