| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
We don't need those, right?
We don't even build that folder anymore (since 1b0fa91), it is just dead
code.
|
|\
| |
| | |
Better error message than 'bad symbolic reference'.
|
| |
| |
| |
| |
| |
| | |
Let's not scare people, and try to give them some advice.
PS: we should really come up with a better mechanism for testing errors/warnings
|
|\ \
| | |
| | | |
Remove "throws InvalidEscapeException" from StringContext.raw doc
|
| | |
| | |
| | | |
As pointed out by @som-snytt, \u0023 is #, not \u0025.
|
| |/
| |
| | |
Since StringContext.raw doesn't escape its input, it does not call `treatEscapes` and cannot throw the InvalidEscapeException.
|
|\ \
| | |
| | | |
Remove invalidation from Global.scala
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The invalidation has been introduced in these commits:
https://github.com/scala/scala/commit/167309afd10f9b65b35e6874a30ea6340a1ddc44
https://github.com/scala/scala/commit/ace051ff0abe112b767c3912f846eb4d50e52cf5
https://github.com/scala/scala/commit/e156d4a7cf4afdab91b7c281a0e8ae6e4743cc4a
It's safe to remove this functionality. It was added originally to support an experiment with resident compilation. The experiment was performed in sbt and dropped in https://github.com/sbt/sbt/commit/6def08e029e474dc35af04b7403a2aeaddd0dec6
Since then Scala team concluded to not work on resident compilation so it's safe to delete unused code.
|
|\ \ \
| | | |
| | | | |
Assortiment of cleanups and comments around the backend
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
The final flag is computed correctly by javaFlags.
|
| | | | |
|
| | | | |
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The code that generated the Java varargs forwarder was basing
things on the `ValDef-s` of the parameters of the source method.
But, their types refer to a type parameter skolems of the enclosing
method, which led to a type mismatch when typechecking the forwarder.
Instead, I've reworked the code to simply use the `DefDef`-s symbol's
info, which *doesn't* refer to skolems. This actually simplifies the
surrounding code somewhat; rather than repeated symbols in a map
we can just time travel the pre-uncurry method signatures to figure
out which params are releated.
|
|\ \ \
| | | |
| | | | |
SI-8736 Restore -language to former glory
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Now `-language` with no option will emit an error:
```
$ skalac -feature -language unused.scala
scalac error: '-language' requires an option. See '-language:help'.
scalac -help gives more information
```
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
MultiChoice allows -language to work like -Xlint.
The bug as described was that the setting value was set instead of updated
(++=) with additional flags.
The unreported bug was that `_` no longer set all settings.
The corrected behavior is that "contains" means "it was enabled, or
_ was set and it was not disabled explicitly."
That is the behavior of `-Xlint` but with a different mechanism,
since each lint option is a Setting.
A semantic difference is that -Xlint enables all the lint options,
but -language does not enable all the language features. `scalac -X` does
not explain this additional behavior of the `-Xlint` flag.
Also worth noting that `scalac -feature -language unused.scala` failed
in 2.11.1 but succeeds silently now.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
Missed the case of comparing a non-empty range to an empty one. Fixed by checking nonEmpty/isEmpty on other collection.
Added a test to verify the behavior.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Clean-up code review comments.
MultiChoice takes a helper function for outputting help text.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Enables -Xlint:help and -language:help.
The Settings API makes it difficult to innovate.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
SI-8525 -Xlint:nowarn-missing-interpolator
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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 `_`.)
|
|\ \ \ \
| | | | |
| | | | | |
SI-8557 make scaladoc normalize paths of external jars.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5919 TypeTags and Exprs should be serializable
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- 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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-8703 add support for blocks with just a single expression to quasiquotes
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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 }".
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
relaxes attachment-matching rules
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
|\ \ \ \ \ \ \
| |_|_|/ / / /
|/| | | | | | |
prevents c.internal.subpatterns from destroying rangeposes
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix -Yno-adapted-args, it would just warn, not err
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8608 f interpolator emits constant strings
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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"
```
|
| |/ / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8117 Fix bug when mixing well-positioned named and positional args
|
| |/ / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The method `missingParams` which returns undefined parameters of
a given invocation expression still assumed that named arguments can
only appear after positional ones.
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- 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`
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8708 Fix pickling of LOCAL_CHILD child of sealed classes
|