| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixed in SI-5508 / cca4d51db.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sealed abstract classes (like `List`) have a primary constructor, public
by default. It can never be called by external code but it shows up in
the scaladoc as a nice `new List()` construtor...
If a class is only abstract, the constructor is still useful because
people can subclass and call it. If it is only sealed (i.e. effectively final),
then it is the normal constructor of a final class. But sealed *and*
abstract makes documenting the constructor useless.
This should remove the misleading constructors of `List`, `Double`,
`Option` and others from the scaladoc.
|
|\
| |
| | |
Fix tests under -Ydelambdafy:method
|
| |
| |
| |
| | |
This should have been done in 63207e1
|
| |
| |
| |
| | |
https://issues.scala-lang.org/browse/SI-8898
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
the structure of Option.class generated by delambdafy:method is
slightly different. For example, lambdas declared within Option are
not emitted as nested classes, so under delambdafy:method there's no
inner class entry for anonfun classes.
The test failed because serializing a ClassTag involves serializing an
Option. Option did not have a `@SerialVersionUID`, and the classfile
generated by delambdafy:method has a different value.
The annotation is required on the parent class (Option) as well as the
subclasses (Some / None). De-serializing a Some will fail if Option
has a different SerialVersionUID.
Relates to SI-8576. We should probably have more SVUID annotations in
the library.
|
| |
| |
| |
| | |
Should have been done in 63207e1.
|
|\ \
| | |
| | | |
SI-8931 make generic signature consistent with interface list in classfiles
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
An optimization was introduced in 7a99c03 (SI-5278) to remove redundant
interfaces from the list of implemented interfaces in the bytecode.
However the same change was not propagated to the generic signature
of a class, which also contains a list of direct parent classes and
interfaces.
The JVM does not check the well-formedness of signatures at class
loading or linking (see §4.3.4 of jdk7 jvms), but other tools might
assume the number of implemented interfaces is the same whether one
asked for generic or erased interfaces.
It doesn't break reflection so nobody complained, but it does show:
scala> val c = classOf[Tuple1[String]]
c: Class[(String,)] = class scala.Tuple1
scala> c.getInterfaces // Product is gone
res0: Array[Class[_]] = Array(interface scala.Product1, interface
scala.Serializable)
scala> c.getGenericInterfaces // Product is back!
res1: Array[java.lang.reflect.Type] = Array(scala.Product1<T1>,
interface scala.Product, interface scala.Serializable)
This moves the optimization to erasure, for use in emitting the generic
signature, and the backend calls into it later for the list of
interfaces.
|
|\ \ \
| | | |
| | | | |
SI-7602 Avoid crash in LUBs with erroneous code
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
If a class contains a double defintion of a method that overrides
an interface method, LUBs could run into a spot where filtering
overloaded alternatives to those that match the interface method
fails to resolve to a single overload, which crashes the compiler.
This commit uses `filter` rather than `suchThat` to avoid the crash.
|
|\ \ \ \
| | | | |
| | | | | |
SI-7019 Fix crasher with private[this] extension methods
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When we move the body of value class methods to the corresponding
extension method, we typecheck a forward method that remains
in the class. In order to allow access, this commit weakens the
access of `private[local]` extension methods to `private`.
|
|\ \ \ \
| | | | |
| | | | | |
SI-8947 Avoid cross talk between tag materializers and reify
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
After a macro has been expanded, the expandee are expansion are
bidirectionally linked with tree attachments. Reify uses the back
reference to replace the expansion with the expandee in the reified
tree. It also has some special cases to replace calls to macros
defined in scala-compiler.jar with `Predef.implicitly[XxxTag[T]]`.
This logic lives in `Reshape`.
However, the expansion of a macro may be `EmptyTree`. This is the case
when a tag materializer macro fails. User defined macros could do the
also expand to `EmptyTree`. In the enclosed test case, the error
message that the tag materializer issued ("cannot materialize
class tag for unsplicable type") is not displayed as the typechecker
finds another means of making the surrounding expression typecheck.
However, the macro engine attaches a backreference to the materializer
macro on `EmpytyTree`!
Later, when `reify` reshapes a tree, every occurance of `EmptyTree`
will be replaced by a call to `implicitly`.
This commit expands the domain of `CannotHaveAttrs`, which is mixed
in to `EmptyTree`. It silently ignores all attempts to mutate
attachments.
Unlike similar code that discards mutations of its type and position,
I have refrained from issuing a developer warning in this case, as
to silence this I would need to go and add a special case at any
places adding attachments.
|
|\ \ \ \
| | | | |
| | | | | |
SI-8962 Fix regression with skolems in pattern translation
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
During the refactoring of error reporting in 258d95c7b15, the result
of `Context#reportError` was changed once we had switched to
using a `ThrowingReporter`, which is still the case in post
typer phase typechecking
This was enough to provoke a type error in the enclosed test.
Here's a diff of the typer log:
% scalac-hash 258d95~1 -Ytyper-debug sandbox/test.scala 2>&1 | tee sandbox/good.log
% scalac-hash 258d95 -Ytyper-debug sandbox/test.scala 2>&1 | tee sandbox/bad.log
% diff -U100 sandbox/{good,bad}.log | gist --filename=SI-8962-typer-log.diff
https://gist.github.com/retronym/3ccbe7e0791447d272a6
The test `Context#reportError` happens to be used when deciding
whether the type checker should be lenient when it hits a type error.
In lenient mode (see `adaptMismatchedSkolems`), it `adapt` retries
with after slackening the expected type by replacing GADT and
existential skolems with wildcard types. This is to accomodate
known type-incorrect trees generated by the pattern matcher.
This commit restores the old semantics of `reportError`, which means
it is `false` when a `ThrowingReporter` is being used.
For those still reading, here's some more details.
The trees of the `run2` example from the enclosed test. Notice that
after typechecking, `expr` has a type containing GADT skolems. The
pattern matcher assumes that calling the case field accessor `expr`
on the temporary val `x2 : Let[A with A]` containing the scrutinee
will result in a compatible expression, however this it does not.
Perhaps the pattern matcher should generate casts, rather than
relying on the typer to turn a blind eye.
```
[[syntax trees at end of typer]] // t8962b.scala
...
def run2[A](nc: Outer2[A,A]): Outer2[Inner2[A],A] = nc match {
case (expr: Outer2[Inner2[?A2 with ?A1],?A2 with ?A1])Let2[A with A]((expr @ _{Outer2[Inner2[?A2 with ?A1],?A2 with ?A1]}){Outer2[Inner2[?A2 with ?A1],?A2 with ?A1]}){Let2[A with A]} =>
(expr{Outer2[Inner2[?A2 with ?A1],?A2 with ?A1]}: Outer2[Inner2[A],A]){Outer2[Inner2[A],A]}
}{Outer2[Inner2[A],A]}
[[syntax trees at end of patmat]] // t8962b.scala
def run2[A](nc: Outer2[A,A]): Outer2[Inner2[A],A] = {
case <synthetic> val x1: Outer2[A,A] = nc{Outer2[A,A]};
case5(){
if (x1.isInstanceOf[Let2[A with A]])
{
<synthetic> val x2: Let2[A with A] = (x1.asInstanceOf[Let2[A with A]]: Let2[A with A]){Let2[A with A]};
{
val expr: Outer2[Inner2[?A2 with ?A1],?A2 with ?A1] = x2.expr{<null>};
matchEnd4{<null>}((expr{Outer2[Inner2[?A2 with ?A1],?A2 with ?A1]}: Outer2[Inner2[A],A]){Outer2[Inner2[A],A]}){<null>}
...
```
|
|\ \ \ \
| |/ / /
|/| | | |
SI-8960 Bring back the SerialVersionUID to anonymous function classes
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In PR #1673 / 4267444, the annotation `SerialVersionId` was changed
from a `StaticAnnotation` to `ClassFileAnnotation` in order to enforce
annotation arguments to be constants. That was 2.11.0.
The ID value in the AnnotationInfo moved from `args` to `assocs`, but
the backend was not adjusted. This was fixed in PR #3711 / ecbc9d0 for
2.11.1.
Unfortunately, the synthetic AnnotationInfo that is added to anonymous
function classes still used the old constructor (`args` instead of
`assocs`), so extracting the value failed, and no field was added to
the classfile.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6626 make @throws tags create links to exceptions
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
In scaladoc, this turns exceptions in @throws tags into links
(when it can find the target exception), instead of just showing
the name.
|
|\ \ \ \
| | | | |
| | | | | |
SI-5217 Companion privates in scope of class parms
|
| | |/ /
| |/| |
| | | |
| | | | |
Test of the same. It progressed in 2.10.1.
|
|\ \ \ \
| | | | |
| | | | | |
SI-8898 javap -fun under new style lambdas
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
To support both -Ydelambdafy strategies, look for both inline
(anonfun) and method (lambda) closure classes.
For method (lambda) style, use the anonfun method that is
invoked by the accessor.
Also, the output of javap must be captured eagerly for
filtering for the current target method.
If the user asks for a module, e.g., `Foo$`, don't yield
results for companion class, but for `Foo`, do yield
companion module results. Just because.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5091 Move named-args cycle test from pending to neg
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6051 Test case, the issue seems to be fixed.
|
| | |/ / / / |
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
There is a typechecking cycle, and since 4669ac180e5 we now report
this in a clearer manner.
Once we change the language to unconditionally interpret an
assignent in argument position as a named argument would be the
only way to get this over to `pos`.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6541 valid wildcard existentials for case-module-unapply
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Instead of letting the compiler infer the return type of case module
unapply methods, provide them explicitly.
This is enabled only under -Xsource:2.12, because the change is not
source compatible.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The default value was NoScalaVersion before, because tryToSet (where
the default was supposed to be set) is not called at all if the option
is not specified.
The initial value of Xmigration is set to NoScalaVersion (which it was
before, the AnyScalaVersion argument was ignored). AnyScalaVersion
would be wrong, it would give a warning in `Map(1 -> "eis").values`
if the option was not specified. See tests.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8927 Update OSGi stuff to get rid of bndlib warning
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The way the desired OSGi frameworks are chosen has changed between
Pax Exam versions:
On earlier versions, specifying it in code was fine, but PAX Exam 4.x
runs the tests on the first OSGi framework it finds on classpath.
An exclusion for the transitive dependency org.osgi.core was added,
because it seems that artifact has broken dependecies (which would
have brought us back to square one).
Good thing is that it isn't needed here, because the OSGi framework JARs
contain all necessary classes.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
SI-8711 ScalaVersion.unparse doesn't produce valid versions
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
There is no dot between `major.minor.rev` and `-build` in a scala
version, yet that's what unparse returns for
```
// was "2.11.3.-SNAPSHOT"
ScalaVersion("2.11.3-SNAPSHOT").unparse
```
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-8893 Restore linear perf in TailCalls with nested matches
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Another excellent test suggestion by Dear Reviewer.
After tail calls, the transform results in:
```
def tick(i: Int): Unit = {
<synthetic> val _$this: Test.type = Test.this;
_tick(_$this: Test.type, i: Int){
if (i.==(0))
()
else
if (i.==(42))
{
Test.this.tick(0);
_tick(Test.this, i.-(1).asInstanceOf[Int]())
}
else
_tick(Test.this, i.-(1).asInstanceOf[Int]()).asInstanceOf[Unit]()
}
};
```
We test this by mostly exercising the tail-recursive code path with
a level of recursion that would overflow the stack if we weren't
using jumps.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
As suggested during code review, this test checks that
the tailcalls phase recurses appropriately below a method
that doesn and does not itself tail call. The test case is
based on the pattern of code that to trigger super-linear
performance in this transform.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Compilation perfomance of the enclosed test regressed when the
new pattern matcher was introduced, specifically when the tail
call elimination phase was made aware of its tree shapes in cd3d34203.
The code added in that commit detects an application to a tail label
in order to treat recursive calls in the argument as in tail position.
If the transform of that argument makes no change, it falls
back to `rewriteApply`, which transforms the argument again
(although this time on a non-tail-position context.)
This commit avoids the second transform by introducing a flag
to `rewriteApply` to mark the arguments are pre-transformed.
I don't yet see how that fixes the exponential performance, as
on the surface it seems like a constant factor improvement.
But the numbers don't lie, and we can now compile the test
case in seconds, rather than before when it was running for
> 10 minutes.
This test case was based on a code pattern generated by the Avro
serializer macro in:
https://github.com/paytronix/utils-open/tree/release/2014/ernststavrosgrouper
The exponential performance in that context is visualed here:
https://twitter.com/dridus/status/519544110173007872
Thanks for @rmacleod2 for minimizing the problem.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-8910 BitSet sometimes uses exponential memory.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Because of an off-by-one error in scala.collection.mutable.BitSet, where a
function (ensureCapacity) is passed a list length instead of an index, when
^=, &=, |=, or &~= are passed BitSets with the same internal capacity as the
set the method is being invoked on, the size of the first BitSet is needlessly
doubled.
This patch simply changes the ensureCapacity calls to pass the last index of
the list, instead of the raw length. In addition, add documentation to
ensureCapacity to try and stop something similar from happening in the future.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-8875 showCode should print all class constructor modifiers.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | | |
showCode used to print nothing when the only modifier was a change in
visibility scope (i.e. no flags but privateWithin is set).
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Make global-showdef a DirectTest
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
You can only show one class or object at a time,
but we can show one of each to reduce the compilations
for this test.
It seems the original issue happened because the test
started to create class files after SI-8217.
So, also stop compile after typer, because why stress the kitteh.
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The test test/files/run/global-showdef.scala was outputting
to the cwd instead of the test output dir.
Good behavior is now inherited from DirectTest.
Test frameworks, of any ilk or capability, rock.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
SI-4950 Add tests, looks like it has been fixed earlier
|
| |/ / / |
|