| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
SI-6556 Remove unneeded workaround in erasure.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In fb6e687, a workaround was added, described as:
> See SI-6556. It seems in some cases the result constructor
> type of an anonymous class is a different version of the class.
> This has nothing to do with value classes per se.
> We simply used a less discriminating transform before, that
> did not look at the cases in detail.
> It seems there is a deeper problem here, which needs
> following up to. But we will not risk regressions
> in 2.10 because of it.
I was expecting an arduous investigation into this,
but happilly the underlying problem was already solved
in the fix for SI-6648 (1587a77e). (Chalk up another
win for libscala's scala-hash!)
This commit escalates the logging to an assertion.
It also reverts the other change in fb6e687,
which introduced a case for RefinedType, which are
not needed to pass pos/t6556.scala.
|
|\ \
| | |
| | | |
Fixed typo in ProcessBuilder scaladoc.
|
| | |
| | |
| | |
| | |
| | | |
ProcessBuilder creation sample code did not complie due to an error
in import statement.
|
|\ \ \
| | | |
| | | |
| | | | |
SI-4859 Step back from mis-optimizations in qualifiers
|
| | | |
| | | |
| | | |
| | | | |
To solve SI-5304, we should change `isQualifierSafeToElide`.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Without this, the following test fails:
SCALAC_OPTS="-optimize" ./test/partest test/files/run/t4859.scala
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Otherwise we fail to throw in:
{???; Predef}.DummyImplicit.dummyImplicit
We still elide the initialization of `Outer` in `Outer.Inner.foo`
as before, although that seems a little dubious to me.
In total, we had to change RefChecks, Flatten, and GenICode
to effect this change. A recently fixed bug in tail call elimination
was also due to assuming that the the qualifier of a Select node
wasn't worthy of traversal. Let's keep a close eye out for more
instances of this problem.
|
| | | | |
|
| | | | |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
Where CC and CC2 are case classes. Attempting to do so leads to
a "no legal prefix" error.
Now, we restrict this optimization (living in RefChecks ?!) to
case class applies with a "safe to inline" qualifier.
|
|\ \ \
| | | |
| | | | |
dealiasing and annotations
|
| | | |
| | | |
| | | |
| | | |
| | | | |
I can't see that it makes any difference, but this is
approximately the way it was before.
|
| | | |
| | | |
| | | |
| | | | |
Good catch, ant target sbt.compile.
|
| | | |
| | | |
| | | |
| | | | |
Surely signfiicant, but I haven't determined in what way.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
It arises when inferring the type of an overloaded call:
def g(s: String): String = s
def f: String = ???
def f[C](c: C): String = g(f)
Also refined warning when isHKSubType is called with
arguments which very likely were never meant to be compared.
|
| | | |
| | | |
| | | |
| | | | |
Incorporates feedback from dealias/widen PR.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Adding a method parameter with a default argument which
deviates from the default at a single call site is a pretty
questionable tradeoff. Even more so when done twice.
Like sands through the hourglass, so go the parameters
of our method.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
isNamed => isNamedArg
isIdentity => allArgsArePositional
nameOf => nameOfNamedArg
Moved mkNamedArg into TreeGen.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When an implicit conversion causes an apparently constant
argument not to be constant, show the conversion, not the
constant.
|
| | | |
| | | |
| | | |
| | | | |
Now there's a position on the synthetic "value" Ident.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is less than ideal:
scala> class Bippy[T] extends annotation.StaticAnnotation
defined class Bippy
scala> def f: Int @Bippy = 5
f: Int @Bippy[T]
Turns out we can infer such types. Now it says:
scala> def f: Int @Bippy = 5
f: Int @Bippy[Nothing]
This should put to rest many an issue with parameterized
annotations.
|
|\ \ \ \
| |/ / /
|/| | | |
Disabled SI-6987.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It causes spurious failures - a typical example:
[partest] testing: [...]/files/run/t6987.scala [FAILED]
[partest] did not get the string expected, full results were:
[partest] Fast Scala compiler version 2.11.0-20130126-111937-f01e001c77 -- Copyright 2002-2013, LAMP/EPFL
[partest] [Given arguments: -shutdown -verbose]
[partest] [Transformed arguments: -shutdown -verbose -current-dir /localhome/jenkins/b/workspace/scala-checkin-manual]
[partest] [VM arguments: ]
[partest] java.net.ConnectException: Connection refused
[partest] [Connecting to compilation daemon at port 32808 failed; re-trying...]
[partest] [No compilation server running.]
[partest]
|
|\ \ \
| |/ /
|/| | |
Merge 2.10.x into master.
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* origin/2.10.x:
SI-6969, mishandling of SoftReferences in method cache.
SI-7011 Fix finding constructor type in captured var definitions
SI-6987 Tests fsc verbose output
SI-6987 Fixes fsc compile server verbose output
SI-6231 Report unsupported free var capture by a trait.
SI-6666 Restrict hidden `this` access in self/super calls.
SI-6902 Check unreachability under @unchecked
SI-6976 Fix value class separate compilation crasher.
Closes SI-6952: add correct error positions for Dynamic feature check.
Conflicts:
src/compiler/scala/tools/nsc/CompileServer.scala
src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
|
| | |\ \
| | | | |
| | | | | |
SI-7011 Fix finding constructor type in captured var definitions
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If a captured var was initialized with an empty tree then finding
the type of the empty tree was being handled improperly. The fix is
to look for primary constructors on the tree's type symbol rather than
the tree's symbol.
A test is included. In order to make the problem more testable the debug
logging of the issue is changed to a debug warn.
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-6231 Report unsupported free var capture by a trait.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If a class nested in a trait captures a free variable from
the enclosing scope of the trait, the transformation to
add that variable to the `init` method of the trait
implementation class happens *after* the abstract trait
interface has been extracted. This would lead to a crash
when trying to find the corresponding interface method.
This commit detects this situation and reports an
implementation restriction. The enclosed test case
shows a workaround.
To lift this restriction, LambdaLifter should add the getters
and make sure they end up in the trait interface. Looks like
Martin tried this once:
// LambdaLift.scala
//
// Disabled attempt to to add getters to freeParams
// this does not work yet. Problem is that local symbols need local names
// and references to local symbols need to be transformed into
// method calls to setters.
// def paramGetter(param: Symbol): Tree = {
// val getter = param.newGetter setFlag TRANS_FLAG resetFlag PARAMACCESSOR // mark because we have to add them to interface
// sym.info.decls.enter(getter)
// val rhs = Select(gen.mkAttributedThis(sym), param) setType param.tpe
// DefDef(getter, rhs) setPos tree.pos setType NoType
// }
// val newDefs = if (sym.isTrait) freeParams ::: (ps map paramGetter) else freeParams
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-6987 Fixes fsc compile server verbose output
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This commit includes a test of fsc's verbose output. In order for it
to work, CompileServer's main method had to be modified to remove a
sys exit 0 at the end. It was redundant and made testing a bit harder.
In order to prevent a race condition between server and client start
up, this commit also adds a server callback that decrements a
CountDownLatch that the main testing thread waits for.
Finally, the server had to be modified to use Console.withErr
and Console.withOut instead of mutating the global System.err
and System.out variables. Otherwise the test would be unreliable.
|
| | | | |/ /
| | | |/| |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Internally the fsc server code was setting a "verbose" flag, but it was
always false. Fixing that gives server's verbose output, but because the
output was buffered and not flushed the server's output wasn't seen
until the compile run was complete. This commit fixes the verbose flag
and flushes the server side output.
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-6666 Restrict hidden `this` access in self/super calls.
|
| | | | |/ /
| | | |/| |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Detect when classes (user authored or compiler generated)
local to a self or super constructor argument would require
premature access to the in-construction instance.
The same restriction applies for classes and objects; for objects,
the premature access would result in a null via MODULE$ field.
A residual error has been lodged as SI-6997.
I'd like to remove calls to `Symbol#outerClass` (which relies on
the flaky flag INCONSTRUCTOR, see my comments in the JIRA issue
for more discussion) from `LambdaLift` and `ExplicitOuter`, and
instead use the stack of active self/super calls to know when to
skip an enclosing class. That will obviate that flag.
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-6902 Check unreachability under @unchecked
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Only exhaustiveness checking should be disabled if the
scrutinee of a match as annotated as `: @unchecked`.
This was the pre-2.10.x behaviour.
This also fixes a variation of the closed ticket,
SI-6011. The exhaustiveness check is needed to
safely fallback from emitting a table switch if
duplicate cases are detected.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
Closes SI-6952: add correct error positions for Dynamic feature check.
|
| | | | | | | | |
|
| | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-6969, mishandling of SoftReferences in method cache.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
More interesting to test than it was to fix. The soft
reference is now dereferenced once, the locally stored
underlying value ascertained to be non-null, and the
remainder of the references to the value use the local var.
The enclosed test reliably NPEs without this patch.
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
SI-6976 Fix value class separate compilation crasher.
|
| | | | |_|/ / / /
| | | |/| | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
We can't guarantee that the owner of the value class
is initialized, and if it isn't, the search for the
companion module will turn up bubkis.
This is a localized fix, but I'd be suprised if there
weren't other places that suffered from the same problem.
Wouldn't it be nicer to have something like:
// doesn't force info
sym.raw.info
sym.raw.companionModule
// forces info
sym.info
sym.companionModule
|
| |\| | | | | | | |
|
| | |\ \ \ \ \ \ \
| | | |_|/ / / / /
| | |/| | | | | | |
Fix java7 again
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
It turns out that we do not need to do that. See comment in
`ProfilerVisitor.java`. Also, since recomputing stack frame
map was the only reason we needed to implement
`getCommonSuperClass` we can now remove its implementation
that was causing problems on Java 7 due to a cyclic dependency
involving class loader because we would try to load a class
we are currently transforming and transformer is triggered just
before classloading.
//cc @namin who worked on this code with me.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
We do not need to retransform classes once they are loaded.
All instrumentation byte-code is pushed at loading time.
This fixes a problem with Java 7 that was failing to add
a transformer because we did not declare retransformation
capability in `MANIFEST.MF` file in Java agent jar.
Java 6 allowed to add transformer due to a bug.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Let's stick to 2 spaces for indentation (and no tabs).
|