summaryrefslogtreecommitdiff
path: root/test/files/neg/checksensible.check
Commit message (Collapse)AuthorAgeFilesLines
* Add since arg to deprecationWarning and use itSimon Ochsenreither2016-05-291-1/+1
|
* Use countElementsAsString for summarized warnings.Adriaan Moors2014-07-041-1/+1
|
* Move reporting logic into Reporting traitAdriaan Moors2014-07-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Unclutter Reporter. Move truncation to ReplReporter.Adriaan Moors2014-07-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`...
* SI-6120 Suppress extra warningsSom Snytt2013-12-161-16/+1
| | | | | | | | | | | | | | | | This is a mere polish for the fix to allow multiple warnings. Sensibility checks in refchecks were shown to be redundant. This commit includes a mild refactor to reduce tabbage, and uses a local var to flag that a warning has already been emitted. It would be better to have the checks return true if warned, to facilitate `nonSensically || unrelatedly`, etc., but that's a lot of `else false`. The check files that were updated with the redundant warnings are reverted.
* SI-6120 multiple warnings at same position.Paul Phillips2013-09-271-1/+16
| | | | | An error suppresses all further warnings at the same position, but multiple warnings can be heard.
* Made -Xfatal-warnings less immediately fatal.Paul Phillips2012-08-101-100/+102
| | | | | | | Instead of changing warnings to errors mid-stream, at the end of a run I check for condition "no errors, some warnings, and fatal warnings" and then generate an error at that point. This is necessary to test for some warnings which come from later stages.
* Revert "#653 -- no lub for statement exprs' types"Adriaan Moors2012-06-031-2/+2
| | | | | | | | | I should not have merged this pull request yet. I didn't notice we didn't have a full successful run of the test suite. It looks like it breaks test/files/continuations-neg/lazy.scala and given the pending amount of changes, I prefer to have a stable master. This reverts commit 037d3dcbc5896864aec0f9121eeda23fcc4cd610.
* Don't compute least upper bounds for expressions in statement positions ↵Iulian Dragos2012-06-031-2/+2
| | | | | | | | | | inside blocks. This may save huge amount of time (Fixes SI-5862) for complicated lubs. I had to remove the a check in adapt for the part that transforms <expr> into { <expr>; () } when the expected type is Unit. The reason is in the code. As a side effect, we get more warnings for pure expressions in statement positions (see the change in the test file).
* Next generation of macrosEugene Burmako2012-04-121-100/+100
| | | | | | | | | | | | | | | | | | | | | | Implements SIP 16: Self-cleaning macros: http://bit.ly/wjjXTZ Features: * Macro defs * Reification * Type tags * Manifests aliased to type tags * Extended reflection API * Several hundred tests * 1111 changed files Not yet implemented: * Reification of refined types * Expr.value splicing * Named and default macro expansions * Intricacies of interaction between macros and implicits * Emission of debug information for macros (compliant with JSR-45) Dedicated to Yuri Alekseyevich Gagarin
* Improved warning for insensible comparisons.Paul Phillips2012-01-311-1/+4
| | | | | Utilize knowledge of case class synthetic equals to rule out some comparisons statically. Closes SI-5426.
* Tone down insensible-equality warning.Paul Phillips2011-12-271-7/+1
| | | | Closes SI-5175.
* Fix for comparison warnings.Paul Phillips2011-10-181-21/+27
| | | | | | | | | | | | true == new java.lang.Boolean(true) will in fact sometimes be true. Also fixes a bug caused by this change in r23627. - lazy val SerializableClass = getClass(sn.Serializable) + lazy val SerializableClass = getClass("scala.Serializable") It used to be java.io.Serializable. Hey, let's not change the meaning of existing symbols which are in active use. No review.
* Selective dealiasing when printing errors.Paul Phillips2011-10-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *** Important note for busy commit log skimmers *** Symbol method "fullName" has been trying to serve the dual role of "how to print a symbol" and "how to find a class file." It cannot serve both these roles simultaneously, primarily because of package objects but other little things as well. Since in the majority of situations we want the one which corresponds to the idealized scala world, not the grubby bytecode, I went with that for fullName. When you require the path to a class (e.g. you are calling Class.forName) you should use javaClassName. package foo { package object bar { class Bippy } } If sym is Bippy's symbol, then sym.fullName == foo.bar.Bippy sym.javaClassName == foo.bar.package.Bippy *** End important note *** There are many situations where we (until now) forewent revealing everything we knew about a type mismatch. For instance, this isn't very helpful of scalac (at least in those more common cases where you didn't define type X on the previous repl line.) scala> type X = Int defined type alias X scala> def f(x: X): Byte = x <console>:8: error: type mismatch; found : X required: Byte def f(x: X): Byte = x ^ Now it says: found : X (which expands to) Int required: Byte def f(x: X): Byte = x ^ In addition I rearchitected a number of methods involving: - finding a symbol's owner - calculating a symbol's name - determining whether to print a prefix No review.
* Brought back unrelated type comparison warning.Paul Phillips2011-09-091-21/+27
| | | | | | Figured out how to turn it on by default, even. Closes SI-4979, no review.
* More fiddling with checkSensible.Paul Phillips2010-12-011-5/+5
| | | | | | | | | | warnings. Fixed some bugs revealed by said warnings, and made some minor changes to avoid warnings. (Technically it's not a bug to have unrelated classes compare as equal, but it so often is a bug that it behooves us not to do it intentionally so the warnings stand out.) Disabled the most useful warning for the moment since it'd be wrong with some frequency. No review.
* Found several minor thigns wrong with checkSens...Paul Phillips2010-11-301-21/+21
| | | | | | | Found several minor thigns wrong with checkSensible, which tries to issue warnings for comparisons which will always be true or false. No review.
* An overhaul of checkSensible.Paul Phillips2010-08-101-39/+86
| | | | | | | | gives fewer insensible warnings about actually sensible things, etc. Large test case with 30 warnings elicited. Closes #282 (again), no review.
* Updated remaining test case to reflect the slig...Paul Phillips2009-10-201-20/+14
| | | | | | Updated remaining test case to reflect the slightly differing semantics of the Ordering fix.
* massive new collections checkin.Martin Odersky2009-05-081-2/+2
|
* More deprecation warnings fixed.Iulian Dragos2008-05-191-1/+1
|
* Massive check-in for IDE.Sean McDirmid2007-09-171-1/+1
|
* suppress "scala." prefix in string representati...Adriaan Moors2007-04-191-11/+11
| | | | | | suppress "scala." prefix in string representation of types (in error messages,..)
* removed Console, added 2 testsmichelou2007-03-301-18/+24
|
* fixed bug1011Martin Odersky2007-03-231-1/+10
|
* edited testsMartin Odersky2007-03-221-3/+4
|
* modified sinsibility checks and test casesMartin Odersky2007-03-221-2/+8
|
* (1) added readLong to Console.Martin Odersky2007-03-221-0/+28
(2) added print/read methods to Predef (3) added warnings for non-sensical comparisons