| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Merge 2.10.x into master
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After the merge, the test/run/t7733 started to fail on Jenkins.
I tried to reproduce it locally but I couldn't so I think it's
system dependent failure. Per @retronym's suggestion I moved it to pending
to not block the whole merge.
Conflicts:
bincompat-backward.whitelist.conf
bincompat-forward.whitelist.conf
src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
src/compiler/scala/tools/nsc/typechecker/Macros.scala
src/compiler/scala/tools/nsc/typechecker/Namers.scala
src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
src/compiler/scala/tools/nsc/util/MsilClassPath.scala
src/compiler/scala/tools/reflect/ToolBoxFactory.scala
src/reflect/scala/reflect/internal/ClassfileConstants.scala
src/reflect/scala/reflect/internal/Importers.scala
src/reflect/scala/reflect/internal/Trees.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
test/files/run/macro-duplicate/Impls_Macros_1.scala
test/files/run/t6392b.check
test/files/run/t7331c.check
|
| | |\
| | | |
| | | | |
Merge/2.10.2 to 2.10.x
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Moved an existing test from `pending` to `pos`. Not sure why
it was moved to `pending` in the first place.
Adds a new test distilled from building Scalaz with 2.10.3-RC1.
|
| | | |\
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Better late than never.
Conflicts:
src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
|
| | |\ \ \
| | | |/ /
| | |/| | |
SI-942 A test case, five years adrift.
|
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I'm looking at the changes made in 47f35b587, which
prevented cyclic errors in class file parsing. That fix
is insufficient for, or otherwise complicit in, SI-7778, for
which I've enclosed a pending test.
|
| | |\ \
| | | | |
| | | | | |
SI-7716 Exclude patmat synthetics from bounds checking
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Consider this pattern match translation, that occurs *before* refchecks:
scala> val e: java.lang.Enum[_] = java.util.concurrent.TimeUnit.SECONDS
scala> e match { case x => x }
<console>:9: error: type arguments [_$1] do not conform to class Enum's type parameter bounds [E <: Enum[E]]
e match { case x => x }
^
[[syntax trees at end of refchecks]] // <console>
package $line5 {
case <synthetic> val x1: Enum[_$1] = $line3.$read.$iw.$iw.e;
case4(){
matchEnd3(x1)
};
matchEnd3(x: Enum[_$1]){
x
}
RefChecks turns a blind eye to the non-conformant type `Enum[_$1]` in
the label defs because of `65340ed4ad2e`. (Incidentally, that is far
too broad, as I've noted in SI-7756.)
This commit extends this exception to cover the synthetic ValDef `x1`.
Commit log watchers might notice the similarities to SI-7694.
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-7603 Fix thread safety of FlagTranslation
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We've fingered the true culprit in the previous commit.
|
| | | |/ /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is outside of the Global cake, so we can't assume single
threaded access. A var was introduced in af3daf6fdb that can lead
to incorrect flag interpretation. The reported bug was triggered
in a multi-project SBT build. Java Annotations read from classfiles
were occasionally conferred the TRAIT|INFERFACE|ABSTRACT flag set,
leading to "@Foo is abstract, cannot be instatiated" later down the
line.
|
| | |\ \ \
| | | |/ /
| | |/| | |
[nomaster] macro expansions are now auto-duplicated
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The fix still requires macro developers to be careful about sharing trees
by references, because attributed DefTrees will still bring trouble.
However this is an improvement, because it doesn't make matters worse
and automatically fixes situations similar to one in the test.
A much more thorough discussion with a number of open questions left:
http://groups.google.com/group/scala-internals/browse_thread/thread/492560d941b315cc
Was fixed ages ago in master in one of the paradise backports.
Never got to 2.10.x, but it's very useful, so I'm backporting it now.
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-7752 Don't disambiguate type parameters of overloaded alts
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
These are passed through from `InferencerContextErrors#applyErrorMsg`
to `withDisambiguation` as the `locals` parameter, which is promptly
ignored. This looks to be an unintended change in 39938bcc299.
Without this patch, the enclosed test case enters a pathalogical
disambiguation session, that not only flirts with unpleasant big-O
complexities, but also flails about appending "(in method foo)"
only to find that *all* occurences of the same-named type parameter
come from some method named "foo".
[snipping error message 40 seconds in the making]
method foo), O(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), P(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), Q(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), R(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), S(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), T, U(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), V)
cannot be applied to (Int)
foo((1))
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-7014 Annot arg may refer to annotated class's member
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This only reduces the crasher to a warning.
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
[Rebase #2771] SI-7694 @uncheckedBounds, an opt-out from type bounds checking
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Followup to the previous commit that added the compiler support
for opting out of bounds checking.
With both pieces, we can test that the temporaries introduced
by the named/default arguments transform don't trigger bounds
violations.
|
| | | |/ / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Synthetic defs introduced by transforms like named/default arguments,
ANF (in scala-async) often introduce a type tree (the tpt of the temporary)
that are based on the types of expressions. These types are scrutinized in
RefChecks to check that type parameter bounds are satisfied.
However, the type of the expression might be based on slack a LUB that
fails to capture constraints between type parameters.
This slackness is noted in `mergePrefixAndArgs`:
// Martin: I removed this, because incomplete. Not sure there is a
// good way to fix it. For the moment we just err on the conservative
// side, i.e. with a bound that is too high.
The synthesizer can now opt out of bounds by annotating the type as follows:
val temp: (<expr.tpe> @uncheckedBounds) = expr
This facility is now used in named/default arguments for the temporaries
used for the reciever and arguments.
The annotation is hidden under scala.reflect.internal, rather than in
the more prominent scala.annotation.unchecked, to reflect the intention
that it should only be used in tree transformers.
The library component of this change and test case will be included in the
next commit. Why split like this? It shows that the 2.10.3 compiler will
work with 2.10.2 scala-reflect.jar.
|
| | |\ \ \ \
| | | |/ / /
| | |/| | | |
SI-7020 Determinism for pattern matcher warnings
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Use LinkedHashSet for the DPLL algorithm for determistic
counter example generation.
Before, the test compiled with:
[info] v2.10.2 => /Users/jason/usr/scala-v2.10.2-0-g60d462e
test/files/neg/t7020.scala:3: warning: match may not be exhaustive.
It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List(_, _)
List(5) match {
^
test/files/neg/t7020.scala:10: warning: match may not be exhaustive.
It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List(_, _)
List(5) match {
^
test/files/neg/t7020.scala:17: warning: match may not be exhaustive.
It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(??, _)
List(5) match {
^
test/files/neg/t7020.scala:24: warning: match may not be exhaustive.
It would fail on the following input: List(_, _)
List(5) match {
^
|
| | |\ \ \ \
| | | |/ / /
| | |/| | | |
SI-7733 reflective packages now more consistent with scalac
|
| | | |/ /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previously PackageScopes from scala.reflect ignored all classes that
had $'s in non-rightmost positions in their names.
Unfortunately this behaviour is inconsistent with how scalac does things,
and I reconciled this as usual, by pulling corresponding logic into
scala-reflect.jar and sharing it between runtime reflection and compiler.
This change has seprate pull requests for 2.10.x and 2.11.0. The latter
deprecates `scala.tools.nsc.util.ClassPath.isTraitImplementation`
whereas the former (which you're looking at right now) does not, because
we can't deprecated members in minor releases.
|
| | |\ \ \
| | | | | |
| | | | | | |
showRaw now prints symbols of def trees
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
A very useful addition that came in handy when hacking macro annotations
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
currentRun.compiles now correctly works in toolboxes
|
| | | | |/ /
| | | |/| |
| | | | | |
| | | | | | |
Another random bug uncovered and extinguished when hacking macro annots.
|
| | |\ \ \ \
| | | |/ / /
| | |/| | | |
[nomaster] macro errors now always have positions
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Back then when I implemented macros for inclusion in trunk (Spring 2012),
partest didn't support the _1, _2, ... convention for neg tests, so I had
to use toolboxes to test macro-generated exceptions.
Unfortunately toolboxes aren't very good with positions (mostly because
their inputs are almost always constructed without corresponding sources)
so I didn't notice that errors signalizing about macro-generated
exceptions actually don't carry positions with them because of a typo.
This patch fixes the oversight, but it doesn't need to be ported to master,
because over there everything's already fixed by one of the backports
from macro paradise.
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-7331 tb.parse returns unpositioned trees
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit gets rid off code wrapping that was previously used by
toolbox to get into correct parsing mode. Instead combination of
templateStats/accept(EOF) is used. This is the same solution as the one
used in repl and built-in scriptRunner
This pull request doesn't attempt to generalize this approach in any
way and re-use it all over the place due to the caution of possible
accidental compatibility breakage. I plan to do it separately against
master.
Additionally there are a few more changes that make importers be aware
of positions and a test for that (via @jedesah).
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-4907 SI-4615 scala.bat now honors -J and -D options.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This makes scala.bat parse and use -J and -D arguments.
Specifically:
- Parameters starting with -J are stripped of the prefix, unquoted if
necessary and appended to %JAVA_OPTS% or default values.
- Parameters starting with -D are unquoted if necessary and then
appended to the others. The right-hand side of a property can be
quoted or not.
- All of those are given to `java` before any other parameters.
- The above only happens on parameter preceding the first parameter
that does not start with "-" (usually a class name).
- The exact arguments passed to scala.bat are also given as-is to
the scala launcher (including -J and -D arguments).
set JAVA_OPTS=-Xmx512m
scala -J-Xmx128m -Dprop1=42 -Dprop2="hello world" "-Dprop3=bar"
"-J-Xms64m" Test foo
will result in
java -Xmx512m -Xmx128m -Dprop1=42 -Dprop2="hello world" -Dprop3=bar
-Xms64m [cp, scala main] -J-Xmx128m -Dprop1=42 -Dprop2="hello world"
"-Dprop3=bar" "-J-Xms64m" Test foo
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
Assorted toolbox fixes
|
| | | |/ / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Apparently there are still discrepancies between how the vanilla compiler
turns class files into symbols and how the reflective compiler does it.
Working on bringing these guys in sync, one bug at a time.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7763 Avoid dropping casts in erasure
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Even if the result isn't used, the potential ClassCastException
is observable, so we must retain them.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
466b7d29f avoided quadratic complexity in Erasure's treatment
of chained `asInstanceOf` calls. It did so by using the typechecked
qualifier, rather than discarding it.
However, that also dropped the cast altogether! In many cases this
was masked by later inclusion of a cast to the expected type
by `adaptToType`:
at scala.tools.nsc.transform.Erasure$Eraser.cast(Erasure.scala:636)
at scala.tools.nsc.transform.Erasure$Eraser.scala$tools$nsc$transform$Erasure$Eraser$$adaptToType(Erasure.scala:665)
at scala.tools.nsc.transform.Erasure$Eraser.adapt(Erasure.scala:766)
at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5352)
This commit re-wraps the typechecked `qual` in its original
`<qual>.asInstanceOf[T]` to preserve semantics while avoiding
the big-O blowup.
The test includes the compiler option `-Ynooptimize` because dead code
elimination *also* thinks that this cast is superfluous. I'll follow up
on that problem seprately.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7785 Preserve TypeVar suspension through TypeMaps
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
During `findMember`, TypeVars in `this` are placed into suspended
animation. This is to avoid running into recursive types when
matching members to those in base classes.
However, the mechanism used to do this is superficial, and doesn't
work when TypeVars are copied by TypeMaps. This seems to crop up
when using `AppliedTypeVar` with higher-kinded type vars.
In the enclosed test case, the cyclic type led to a SOE in
CommonOwnerMap.
This commit allows a TypeVar to delegate its `suspended` attribute
to the TypeVar from which it was copied. This is done in
`TypeVar#applyArgs`, which is called by:
// TypeMap#mapOver
case tv@TypeVar(_, constr) =>
if (constr.instValid) this(constr.inst)
else tv.applyArgs(mapOverArgs(tv.typeArgs, tv.params))
We should review the other places this is called to make sure
that it make sense to link in this way:
Types#appliedType
TypeVar#normalize
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-7501 Pickler: owner adjustment for param syms in annotation args
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Pickling of trees within annotation arguments led to an unfortunate
situation: the MethodType of a symbol contained a value parameter
symbol that was pickled as though it were owned by the enclosing
class (the root symbol of the pickle.)
Under separate compilation, this would appear as a member of that
class.
Anyone using `@deprecatedName('oldName)` was exposed to this problem,
as the argument expands to `Symbol.apply("oldName")`.
This commit extends some similar treatment of local type parameters
to also consider value parameters.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
(1 of 2) of the rest of the new bytecode emitter + feedback
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
In keeping with the baby steps towards pipelining of
class building and class writing, this commit gets one step closer
to that. Only thing missing: the actual thread-pool.
That will be the focus of an upcoming commit.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
To recap from the previous commit, another baby step towards
pipelining of class building and class writing.
Implementing similar functionality in GenASM is up for grabs,
see https://issues.scala-lang.org/browse/SI-6164
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
This commit and two follow-up commits (recognizable because
of the starting words "decouple this from that" in the commit message)
are baby steps towards pipelining of class building and class writing,
ie allowing class building (which requires typer) and "the rest"
which doesn't) to run in parallel.
The commits have been broken up following a previous review comment.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
GenBCode runs only under a flag, and moreover only if -optimise
is not present (see ScalaSettings for details).
Therefore during a nightly, when tests are run under -optimise,
we need -Ynooptimise to deactivate the optimizer.
With that, GenBCode can run and tackle the test case successfuly.
|
|\ \ \ \ \ \ \ \ \ \
| |_|_|_|_|/ / / / /
|/| | | | | | | | | |
A better diagnostic error for corrupt or missing JARs.
|