| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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.
|
|\
| |
| | |
Add tests for ConsoleReporter.
|
| | |
|
|\ \
| | |
| | | |
Don't use `equals` for comparing java.lang.Double/Float
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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`.
|
|\ \ \
| | | |
| | | | |
SI-10187 Support mutation of mutable.HashMap in getOrElseUpdate
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Scala 2.12.1 included optimizations to `HashMape.getOrElseUpdate`
to avoid recomputing the index in the hash table when adding an
the element.
However, this index could be stale if the callback added elements
to the map and triggered a resize.
This commit checks that the table is unchanged before reusing
the index, restoring the 2.12.0 behaviour.
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Follow-up to fb061f22d4c35df626d9651e017820a11f8fe56e
which allowed the type param only.
Reported:
```
scala> object Test {
| def a[R](implicit s: List[R]):Int = 0
| def a_=[R](v: Int)(implicit s: List[R]) = ()
| }
```
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Further small HashTable optimizations
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
fix regression in scaladoc
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Avoid compiler crash with missing transitive dependencies
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Given that we correctly setup the flags on the stub symbol,
we no longer trip an assertion in ModuleTypeRef's constructor.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In this test case, the backend forces the specialization
info transform of `Sub` during computation of its
inner class metadata. This in turn runs the info transforms
of the `Base`. This leads to the uncurry info tranform
transforming a signature that has a type alias as a
method parameter type. Subsequent substution of the new
method symbol into the result type, which includes a
stub symbol for an absent class, tripped an assertion:
```
requirement failed: package b
java.lang.IllegalArgumentException: requirement failed: package b
at scala.Predef$.require(Predef.scala:277)
at scala.reflect.internal.Types$ModuleTypeRef.<init>(Types.scala:1879)
at scala.reflect.internal.Types$PackageTypeRef.<init>(Types.scala:1897)
at scala.reflect.internal.Types$TypeRef$.apply(Types.scala:2401)
at scala.reflect.internal.Types.typeRef(Types.scala:3553)
at scala.reflect.internal.Types.typeRef$(Types.scala:3536)
at scala.reflect.internal.SymbolTable.typeRef(SymbolTable.scala:16)
at scala.reflect.internal.Symbols$TypeSymbol.newTypeRef(Symbols.scala:3026)
at scala.reflect.internal.Symbols$TypeSymbol.updateTypeCache(Symbols.scala:3079)
at scala.reflect.internal.Symbols$TypeSymbol.maybeUpdateTypeCache(Symbols.scala:3065)
at scala.reflect.internal.Symbols$TypeSymbol.tpe_$times(Symbols.scala:3043)
at scala.reflect.internal.Symbols$Symbol.typeOfThis(Symbols.scala:2020)
at scala.reflect.internal.Types$ThisType.underlying(Types.scala:1184)
at scala.reflect.internal.Types$SimpleTypeProxy.boundSyms(Types.scala:150)
at scala.reflect.internal.Types$SimpleTypeProxy.boundSyms$(Types.scala:150)
at scala.reflect.internal.Types$SingletonType.boundSyms(Types.scala:1088)
at scala.reflect.internal.tpe.TypeMaps$SubstMap.apply(TypeMaps.scala:726)
at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:789)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:102)
at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:783)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:102)
at scala.reflect.internal.tpe.TypeMaps$SubstSymMap.apply(TypeMaps.scala:783)
at scala.reflect.internal.Types$Type.substSym(Types.scala:727)
at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:123)
at scala.reflect.internal.transform.UnCurry$$anon$1.apply(UnCurry.scala:53)
at scala.reflect.internal.transform.UnCurry.transformInfo(UnCurry.scala:154)
```
This commit address the direct failure above by setting coherent flags on
the stub package class symbol (it also needs the MODULE flag).
|
|\ \ \ \
| | | | |
| | | | | |
Improved error messages for identically named, differently prefixed types
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | |_|/ /
| |/| | /
| |_|_|/
|/| | | |
inlineToStr is not exhaustive and does not remove html tags inside HtmlTag [ci: last-only]
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
scala.xml.XML.loadString(tag).text will remove all html tags inside the HtmlTag
use a regex to remove html tags inside the tag
added some tests for the inlineToStr-method
moved inlineToStr to companion object of Page
added test for nested html tags
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
Fix regression introduced by 5751763
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| |/ / /
|/| | | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-9704 don't add a closing HtmlTag if it is already closed
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
gourlaysama/ticket/sd-256-enable-repl-colors-unix-2
Enable colored output by default on unix
Fix scala/scala-dev#256
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
`scala.color` now has 3 states: `true`, `false` and `auto`
(the default). `auto` allows colors if not on windows and if the shell
is interactive (as in, both stdin and stdout are a tty).
The autodetect works as expected when run via SBT too, and it can always
be overriden on the CLI or via JAVA_OPTS.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Fix erasure of the qualifier of ##
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-10194: Fix abstract type resolution for overloaded HOFs
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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).
|