| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-8040 Improve unused warnings
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
| |
Improve documentation some packages and correct some typos in these directories,
- compiler
- library
|
| |
|
|\
| |
| | |
SI-10133 Require escaped single quote char lit
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
The spec specifically requires `'\''` and not `'''`.
The error consumes all consecutive single quotes.
|
| |
| |
| |
| | |
The test for non-zero must recognize `-0e+00f` and variants.
|
|\ \
| | |
| | | |
SI-10148 Follow Java for float literals
|
| |/
| |
| |
| |
| | |
Use `Float.parseFloat` instead of converting from Double.
Error when a value rounds to zero.
|
|\ \
| | |
| | | |
SI-4986 The glorious return of Comma McTraily
|
| | |
| | |
| | |
| | | |
From https://github.com/scala/scala/pull/5245#issuecomment-266658070
|
| |/ |
|
| |
| |
| |
| |
| |
| | |
For 2.12 migration, insert missing case class param section,
strip caseaccessor from implicit paramsection,
and deprecate the adaptation.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Current semantics are that leading implicit param
turns the parameter section into an implicit section
(though without making other params implicitly
implicit).
Warn if more than one head of a param section is
implicit, since that results in multiple implicit
param sections.
|
| |
| |
| |
| |
| |
| |
| | |
Instead of aborting when a class def has extra
parameter section, take all parameter sections
and sanity check the use of leading implicit
to indicate an implicit parameter section.
|
|/
|
|
|
|
|
|
|
|
| |
Case class must have a non-implicit param list.
Error early, error often.
Also update spec to say that class implicitly gets
a non-implicit parameter section if it doesn't
have one, and that a case class must have one.
|
|\
| |
| | |
SI-9944 Scan after interp expr keeps CR
|
| |
| |
| |
| |
| |
| | |
In an interpolated expression `s"""${ e }"""`, the scanner
advances input past the RBRACE. If a multiline string as
shown, get the next raw char, because CR is significant.
|
| | |
|
|/
|
|
|
|
|
| |
Align the Scala and Java doc comment scanning methods a bit.
The Scala one especially had gotten a bit messy,
with regular block comments being kind of accumulated,
but never actually registered as DocComments.
|
|
|
|
|
| |
* Hook into java parser to generate doc comments
* Generate empty trees for java implementation bodies
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fresh name for catcher gets a dollar. "Here, have a dollar."
Test due to retronym demonstrates possible conflict.
Over the lifetime of the universe, surely at least one code
monkey would type in that identifier to catch a banana.
|
|\| |
|
| |
| |
| |
| |
| |
| | |
Fixed the warning when main module is accompanied by snippets.
Minor clean-up so even I can follow what is returned.
|
| |
| |
| |
| |
| |
| | |
It's pretty confusing when your script object becomes a local
and then nothing happens. Such as when you're writing a test and
it takes forever to figure out what's going on.
|
| |
| |
| |
| |
| |
| |
| | |
In an unwrapped script, where a `main` entry point is discovered
in a top-level object, retain all top-level classes.
Everything winds up in the default package.
|
| |
| |
| |
| | |
Scripting knows it by name.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Cheap name test: if the script object extends "App",
take it for a main-bearing parent.
Note that if `-Xscript` is not `Main`, the default,
then the source is taken as a snippet and there is
no attempt to locate an existing `main` method.
|
| | |
|
|\ \
| | |
| | | |
SI-8044 Allow binding backquoted varid in patterns
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Allows arbitrary identifier in `X @ pat`, including
non-varids. This goes to regularity.
Users of this syntax are not likely to be confused
by the "backquoted var id is stable" rule.
Also for sequence pattern, `X @ _*`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously, a varid could not be backquoted, so that it was not
possible to introduce variables with names such as `type` in a
match expression.
This commit allows backquoted varids in `case x @ _` and
`case x: Int`. In neither position is a stable id accepted,
that is, an id with leading uppercase.
Therefore, this commit merely relaxes the backquoted varid to
be taken as a normal varid in these contexts.
|
|\ \ \
| |/ /
|/| | |
SI-9665 Backquoted vbar in extractor pattern
|
| | |
| | |
| | |
| | | |
Allow an infix extractor named `|`, when backquoted.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The body of `def delay[T](v: => T) = (v _): F0[T]`
becomes `() => v` during `typedEta`, and then uncurry
considers whether to strip the function wrapper since
`v` is known to be a `Function0` thunk. Stripping is sound
when the expected type is `Function0` for this expression,
but that's no longer a given, since we could be expecting any
nullary SAM.
Also sweep up a bit around `typedEta`.
Encapsulate the, erm, creative encoding of
`m _` as `Typed(m, Function(Nil, EmptyTree))`.
|
|/ /
| |
| |
| |
| |
| | |
Added a deprecation warning for `-optimize`.
Later we'll also graduate `-Yopt` to `-opt`, probably for 2.12.0-M5.
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
build.sbt
scripts/jobs/integrate/bootstrap
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit adds explicit checks with syntax errors for tuple literals
and types of more than 22 elements. An alternative approach to fixing
SI-9572 would be to revert to the old failure mode of Scala 2.10 where
references to arbitrary `scala.TupleXY` would be generated in the
parser, which then leads to “type/object not found” errors in the
typechecker. This fix here is more intrusive but arguably provides a
better user experience.
Methods `stripParens` and `makeBinop` are moved from `TreeBuilder` to
`Parsers` because they can now generate syntax errors. New methods
`makeSafeTupleType` and `makeSafeTupleTerm` implement the error checking
on top of `makeTupleType` and `makeTupleTerm`. They are overridden with
no-op versions in the quasiquotes parser because it also overrides `makeTupleType` and `makeTupleTerm` in a way that supports arbitrary tuple sizes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Language imports are preceding other imports
- Deleted empty file: InlineErasure
- Removed some unused private[parallel] methods in
scala/collection/parallel/package.scala
This removes hundreds of warnings when compiling with
"-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A trio of problems were hampering autocompletion of annotations.
First, given that that annotation is written before the annotated
member, it is very common to end parse incomplete code that has a
floating annotation without an anotatee.
The parser was discarding the annotations (ie, the modifiers) and
emitting an `EmptyTree`.
Second, the presetation compiler was only looking for annotations
in the Modifiers of a member def, but after typechecking annotations
are moved into the symbol.
Third, if an annotation failed to typecheck, it was being discarded
in place of `ErroneousAnnotation`.
This commit:
- modifies the parser to uses a dummy class- or type-def tree,
instead of EmptyTree, which can carry the annotations.
- updates the locator to look in the symbol annotations of the
modifiers contains no annotations.
- uses a separate instance of `ErroneousAnnotation` for each
erroneous annotation, and stores the original tree in its
`original` tree.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I imagine these date back to old Subversion days and are probably the
result of inadvertent commits from Windows users with vcs client
configs.
having the bit set isn't really harmful most of the time,
but it's just not right, and it makes the files stand out in directory
listings for no reason
|
| |
| |
| |
| | |
Since it's a private method, it's safe to just rename it.
|
| |
| |
| |
| |
| |
| |
| |
| | |
only trivial merge conflicts here.
not dealing with PR #4333 in this merge because there is a substantial
conflict there -- so that's why I stopped at
63daba33ae99471175e9d7b20792324615f5999b for now
|