| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The next commit fixes the problem itself and it's easier to see
in diff what's being fixed exactly.
|
|\
| |
| | |
[backport] 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]
(cherry picked from commit 53d5df5c1d52b941732c243159de4f44456f03b4)
|
|\
| |
| | |
[backport] SI-3577 BoundedWildcardType handling
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
commit 3c91b32d699a9e29d685ac20c9805f96c9f2db2c
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Fri Aug 24 01:16:47 2012 +0200
Mention BoundedWildcardType in "a standard type pattern match".
(cherry picked from commit 00e46b3dbcea2b72fd3941b7ffc2efba382871e9)
commit 0664be2b69b1ce013e937bc93f4e84b891676f1f
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Fri Aug 24 01:05:07 2012 +0200
Make RefChecks#validateVariance aware of BoundedWildcardType.
The only test case that I know for this will be neutered
by the imminent fix for SI-6258; so I haven't been able to
test this.
But trying this manually, you can see that this patch defers the
the SI-6258 to the erasure phase.
Original:
scala.MatchError: ? (of class scala.reflect.internal.Types$BoundedWildcardType)
at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.scala$tools$nsc$typechecker$RefChecks$RefCheckTransformer$$anon$$validateVariance$1(RefChecks.scala:894)
at scala.tools.nsc.typechecker.RefChecks$RefCheckTransformer$$anon$3.validateVariance(RefChecks.scala:965)
Modified:
java.lang.ClassCastException: scala.reflect.internal.Types$TypeRef$$anon$6 cannot be cast to scala.reflect.internal.Types$TypeBounds
at scala.reflect.internal.Types$TypeMap.mapOver(Types.scala:4160)
at scala.reflect.internal.transform.Erasure$ErasureMap.apply(Erasure.scala:156)
(cherry picked from commit 2b4e7183fd24113cca5e868456668fd05c848168)
commit 6ad651c94faf463133c742feb2aee59ef782ea1f
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Fri Aug 24 00:54:59 2012 +0200
SI-3577 Make varianceInType aware of BoundedWildcardType.
(cherry picked from commit 21105654c40ed0c462142bcbb6c8eced77f8b07a)
|
|\ \
| | |
| | | |
SI-6891 Fix value class + tailrec crasher.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
rhs.substituteSymbols(old, new) leaves us with:
def loop#12225(x#12226: A#15491): scala#21.this.Unit#1615 =
loop#12225(x#12226)
In which the TermSymbol x#12226 has a stale info, pointing at
the A#7274, the class type parameter, rather than A#15491,
the corresponding type parameter of the synthetic backing
method.
I've improved `TreeSymSubstituter` to substitute not
only `Tree#{tpe, symbol}`, but also `DefTree#sym.info`.
The `pos` test that triggered the new code path are
listed here: https://gist.github.com/4575687
AFAICS, no special treatment of Function, Return, or Import
is needed in TreeSymSubstutor.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Find trees which have an info referring to an out-of-scope
type parameter or local symbol, as could happen in the test
for SI-6981, in which tree transplanting did not substitute
symbols in symbol infos.
The enclosed, pending test for that bug that will now
fail under -Ycheck:extmethods -Xfatal-warnings.
[Now checking: extmethods]
[check: extmethods] The symbol, tpe or info of tree `(@scala.annotation.tailrec def loop(x: A): Unit = loop(x)) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root>
[check: extmethods] The symbol, tpe or info of tree `(val x: A = _) : A` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x, method loop, method bippy$extension, object Foo, object O, package <empty>, package <root>
[check: extmethods] The symbol, tpe or info of tree `(loop(x)) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root>
[check: extmethods] The symbol, tpe or info of tree `(loop) : (x: A)Unit` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: method loop, method bippy$extension, object Foo, object O, package <empty>, package <root>
[check: extmethods] The symbol, tpe or info of tree `(x) : A` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x, method loop, method bippy$extension, object Foo, object O, package <empty>, package <root>
[check: extmethods] The symbol, tpe or info of tree `(<synthetic> val x2: O.Foo[A] = (x1.asInstanceOf[O.Foo[A]]: O.Foo[A])) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value x2, method equals$extension, object Foo, object O, package <empty>, package <root>
[check: extmethods] The symbol, tpe or info of tree `(<synthetic> val Foo$1: O.Foo[A] = x$1.asInstanceOf[O.Foo[A]]) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value Foo$1, method equals$extension, object Foo, object O, package <empty>, package <root>
[check: extmethods] The symbol, tpe or info of tree `(Foo$1) : O.Foo[A]` refers to a out-of-scope symbol, type A in class Foo. tree.symbol.ownerChain: value Foo$1, method equals$extension, object Foo, object O, package <empty>, package <root>
error: TreeCheckers detected non-compliant trees in t6891.scala
one error found
|
| | |
| | |
| | |
| | |
| | | |
- allow for re-typechecking by disabling "redefinition of
equals" errors for synthetic methods.
|
|\ \ \
| | | |
| | | | |
SI-4602 Make fsc absolutize source file names
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The included test for fsc path absolutization almost certainly has
the same reliability problem as a similar test that was disabled in
https://github.com/scala/scala/pull/1985 . Disabling the test until
I can figure out a reliable way to test fsc in an our continuous
integration environment.
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The fsc server was using a path supplied by the client to turn things
like class path values into absolute paths. But it wasn't absolutizing
the source file names supplied to the compiler which lead to SI-4602.
This commit adds that absolutizing bit and cleans the logic up a bit
so that the settings object isn't told a path that it already knows.
A test is included that simulates changing directory by forcing two
different -current-dir settings on two different compile sessions on
the same server process.
|
|\ \ \
| | | |
| | | | |
SI-4733 - fsc no longer creates a single temp directory for all users.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
fsc previously created a single temporary directory called
"scala-devel". This is an issue, since the directory belongs to whoever
created the directory. Depending on the user's umask, this directory may
only be writable for the creator. This causes problems for any other
users who then try to use fsc or invoke fsc indirectly.
Other programs usually solve this issue by creating a separate directory
for each user, either by appending the username to a base directory name
or creating a new direcotory with a random name with a program like
"mktemp". This commit changes CompileSocket to use the first method.
Fixes SI-4733
backport to 2.10.x
|
|\ \ \ \
| | | | |
| | | | | |
SI-6863 Fix verify error in captured var inited from block w try/catch
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If a captured var was inited from a try/catch we did something
reasonable. But if the var was inited from a more complicated expression
(if/else, a block, match/case, etc) that ended with
a try/catch then we didn't and we were generating faulty byte code.
This fix patches LambdaLift to add the missing cases.
For known simple expressions, the translation is just new *Ref(expr).
For try/catch, if/else, match/case, and blocks this recursively
walks down the internal result expressions to translate them. E.g.
if(cond) trueExpr else falseExpr becomes if(cone) translate(trueExpr)
else translate(falseExpr)
For unknown expression types, the translation is {val temp = expr; new
*Ref(expr) }
|
|\ \ \ \
| | | | |
| | | | | |
SI-6932 StackOverflowError in chained Future.flatMap calls
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
internal execution context of Future
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6443 Widen dependent param types in uncurry
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
These were already working, due to a serendipitous
ordering of transformations. The tests will keep
it this way.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Bridge building operates on unusual method signatures:
after uncurry, so parameter lists are collapsed; but before
erasure, so dependently typed parameters are still around.
Original:
def foo(a: T)(b: a.type, c: a.U): Unit
During computeBridges:
(a: T, b: a.type, c: a.U)Unit
This signature no longer appears to override the corresponding
one in a superclass, because the types of `b` and `c` are dependent
on method parameters.
The root of the problem is uncurry, which leaves the trees in
a poor state. This commit changes uncurry to remedy this.
An example illustrates it best:
// source
def foo(a: A)(b: a.type): b.type = b
// post uncurry before this patch.
// not well typed code!
def foo(a: A, b: a.type): a.type = {
// post uncurry after this patch
def foo(a: A, b: A): A = {
val b$1 = b.asInstanceOf[a.type]
b$1
}
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7018 Fix memory leak in Attachments
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The build is currently broken:
https://scala-webapps.epfl.ch/jenkins/view/2.10.x/job/scala-nightly-main-2.10.x/
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Makes NonEmptyAttachments a top level class so that
it doesn't accidentally accumulate history via the
$outer field.
No test is included because I think the fix is
self evident.
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
Bumped partest MaxPermSize to 128m.
|
|/ / / / / |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
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).
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The ASM ClassWriter uses a wimpy class loader when computing common
superclasses. This could cause a ClassNotFoundException in the
transform method (at reader.accept). This exception gets swallowed,
resulting in a class that should be instrumented to silently not
be. The fix is to override getCommonSuperClass to use the correct
class loader.
Trivia: This bug was discovered while 'stress-testing' this
instrumentation scheme on the Coursera students, to check that they
implement one method in terms of another in the assignment.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Use the same default scalac options in all three partest frontends
|