| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Also moves some tests into suitable packaging.
|
|
|
|
|
|
|
|
|
|
|
| |
ScalaCheck ever being under partest in the first place is ancient
history, from back in the Ant build days (shudder)
ScalaCheck support was removed from partest 1.1.0, which we already
upgraded to in a recent commit
also upgrades ScalaCheck from 1.11.6 to 1.13.4, since we might
as well. no source changes were necessary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
upgrades partest from 1.0.17 to 1.1.0
https://github.com/scala/scala-partest/pull/69
changed the mode for mixed compilation, which used to be
1. scalac *.java *.scala -d o
2. javac *.java -d o -cp o
3. scalac *.scala -d o -cp o
Now the third step is skipped. This required some adjustments to existing
tests.
- t7014 is split in two groups, the fix is for separate compilation.
- t7582 is also split. It tests inliner warnings when inling code that accesses
Java-defined package-private code. Inlining from Java only works in separate
compilation (no bytecode available in mixed compilation).
- Java compiler warnings of "run" tests were not reported in the old scheme,
now they are. Deprecation / unchecked warnings were removed from t6240, t8786,
varargs.
- t4788 required a .check file update to pass, which hints at a bug. I will
re-open SI-4788 and investigate later.
|
|
|
|
| |
added missing overrides for TreeMapView
|
|
|
|
|
|
| |
Also suffered from the negative `from` bug.
Prefer `math.max` to avoid `RichInt`.
|
|\
| |
| | |
SI-10093 don't move member traits to constructor body in constructors
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes a regression introduced in c8e6050. Member traits with only
abstract definitions (`isInterface`) were moved into the primary
constructor by mistake. (Flatten moved the classes back.)
The member trait was duplicated into the constructor of specialized
subclasses, causing it to be generated multiple times.
Also removes some unnecessary `isMixinConstructor` checks: the mixin
constructor is always the primary constructor.
This commit also clarifies (and tests) what `isInterface` means: for
scala-defined traits, it means there are only abstract members. For
java-defined interfaces, it is always true.
|
| |
| |
| |
| |
| |
| |
| |
| | |
"sbt" is not an acronym (it used to be, but it isn't any longer).
It's a proper name, like "iPhone" or "eBay".
So, just like you wouldn't write "Get Started With EBay" or
"How To Reset Your IPhone", we don't write "Using the Sbt Build".
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
merge/2.11.x-to-2.12.x-20161220
Conflicts:
bincompat-backward.whitelist.conf
build.xml
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/library/scala/collection/immutable/NumericRange.scala
|
| | |
| | |
| | |
| | |
| | | |
This allows it to work in Scala.js, which supports `ClassTag`s but
not `Manifest`s.
|
| |\ \
| | | |
| | | | |
SI-3236 constant types for literal final static java fields
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Since we don't parse Java expressions, fields of Java classes coming
from source files never have constant types. This prevents using
static java fields in annotation arguments in mixed compilation
This PR assigns constant types to final static java fields if the
initializer is a simple literal.
|
| |\ \ \
| | | | |
| | | | | |
SI-9834 Improve error on failed op=
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If rewriting `x += y` fails to typecheck, emit error messages
for both the original tree and the assignment.
If rewrite is not attempted because `x` is a val, then say so.
The error message at `tree.pos` is updated with the additional advice.
SI-8763 Crash in update conversion
When there are already errors, don't attempt mechanical rewrites.
|
| | | | |
| | | | |
| | | | | |
SI-10086 NumericRange.min|max with custom Integral
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-10068 Only permit elidable methods
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In refchecks, check that symbol with `@elidable` is a method.
When eliding in uncurry, doublecheck.
The check is enabled under `-Xsource:2.13`.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
SI-10067 Avoid linkage errors with type patterns, Java inner classes
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Followup to the previous commit to remove the unchecked warning
when the speculative outer test is dropped in explicitouter.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If we pretend they do, we can walk into NoSuchMethodErrors when
translating type patterns path dependent types.
This commit avoids this symptom by changing the explicitouter
info transformer. A following commit will change the pattern
matcher itself to avoid speculatively adding this outer check
that will be always dropped in explicitouter.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The behaviour changed in #5550, this commit adapts to the change so
that we'll be binary compatible after boostrapping.
MiMa alerted us to a change in the parentage of two objects in the
forkjoin package object.
In Scala 2.12.0/1, they implemented `scala.Serializable`. Recently,
this (synthetically added) parent was absent. This appears to be
due to a bug fix in `companionSymbolOf`, which no longer treats
objects and same-named type aliases to be companions.
This commit manually adds the formerly-synthetic parents to these
objects, and documents the change in compiler behaviour with a test.
Fixes scala/scala-dev#290
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Remove deprecated -Y flags
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This was slated for removal in 2.12.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This was slated for removal in 2.12.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-10060 Fixes NumricRange.max bug on empty ranges
|
| | | | | | | | |
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-10069 Fix code gen errors with array updates, Nothing
|
| | |_|/ / / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Crashes in ASM or VerifyErrors used to occur when assigning
an expression of type Nothing to an element of a primitive array.
This commit adapts the RHS of the assignment to the element
type to correct this. `adapt` contains logic to insert an
`ATHROW` of the slot of type `Nothing$`, which makes everything
line up. The subsequent array stores become dead code and are
dropped later on in code gen, so the test case compiles to:
public void foo0(double[]);
Code:
0: bipush 42
2: istore_2
3: aload_1
4: iconst_0
5: aload_0
6: invokevirtual #30 // Method throwExpected:()Lscala/runtime/Nothing$;
9: athrow
I found a similar bug in the emission of primitive unboxing and
fixed that too.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-3772 Fix detection of term-owned companions
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Companion detection consults the scopes of enclosing Contexts during
typechecking to avoid the cycles that would ensue if we had to look
at into the info of enclosing class symbols. For example, this used
to typecheck:
object CC { val outer = 42 }
if ("".isEmpty) {
case class CC(c: Int)
CC.outer
}
This logic was not suitably hardened to find companions in exactly
the same nesting level.
After fixing this problem, a similar problem in `Namer::inCurrentScope`
could be solved to be more selective about synthesizing a companion
object. In particular, if a manually defined companion trails after
the case class, don't create an addiotional synthetic comanpanion object.
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|_|/
|/| | | | | | | | |
SI-10075 propagate annotations to lazy val's underlying field
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Based on review suggestion by retronym.
See also scala/scala-dev#213
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This likely regressed in #5294.
Review feedback from retronym:
- Tie annotation triaging a bit closer together
durban kindly provided initial version of test/files/run/t10075.scala
And pointed out you must force `lazy val`, since `null`-valued field
is serializable regardless of its type.
Test test/files/run/t10075b courtesy of retronym
|
| |_|_|_|/ / / /
|/| | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
It wasn't a good idea after all.
Also removed some tracing code that I cannot imagine
was ever used in a production compiler. It's still just
a recompile away.
Fixes scala/scala-dev#280
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
SI-7046 reflection doesn't see all knownDirectSubclasses
This appears to do the right thing in the most typical scenarios in which `knownDirectSubclasses` would be used. The missing 5% is that subclasses defined in local scopes might not be seen by `knownDirectSubclasses` (see `Local` and `Riddle` in the test below). In mitigation, though, it is almost certain that a local subclass would represent an error in any scenario where `knownDirectSubclasses` might be used.
Errors for such situations are reported by recording (via a symbol attachment) that `knownDirectSubclasses` has been called and reporting an error if any additional children are added subsequently.
Despite these limitations and caveats, I believe that this represents a huge improvement over the status quo, and would eliminate 100% of the failures that I've seen in practice with people using shapeless for type class derivation.
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| |_|/ / / / / / /
|/| | | | | | | | |
Clean up of code guarded by bare -Xexperimental
|
| | | | | | | | | |
|
| |/ / / / / / / |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SD-275 Further harden against refs to absentee classes
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
- Limit the strategy of unpickling an external reference to a
module class to a lookup of the module var to non-stub owners
in order to enable fall through to stub symbol creation.
Fixes scala/scala-dev#275
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Optimized HashTable.index
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
(`ops/s`, smaller is better)
`Before (9c5d3f8)`:
```scala
[info] # Run complete. Total time: 00:08:15
[info]
[info] Benchmark (size) Mode Cnt Score Error Units
[info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 645.594 ± 9.435 ns/op
[info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2084.216 ± 37.814 ns/op
[info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 19878.481 ± 262.404 ns/op
[info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 689.941 ± 5.850 ns/op
[info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7357.330 ± 45.956 ns/op
[info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95767.200 ± 1550.771 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 509.181 ± 2.683 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 5563.301 ± 32.335 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 71965.365 ± 1809.738 ns/op
[info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 247.270 ± 3.972 ns/op
[info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5646.185 ± 106.172 ns/op
[info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 81303.663 ± 954.938 ns/op
```
`Changed modulo to bitwise and in hash calculation (4c729fe)`:
```scala
[info] Benchmark (size) Mode Cnt Score Error Units
[info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 631.291 ± 9.269 ns/op
[info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2077.885 ± 59.737 ns/op
[info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 15458.278 ± 317.347 ns/op
[info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 678.013 ± 4.453 ns/op
[info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7258.522 ± 76.088 ns/op
[info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 94748.845 ± 1226.120 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 498.042 ± 5.006 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 5243.154 ± 110.372 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 68194.752 ± 655.436 ns/op
[info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 257.275 ± 1.411 ns/op
[info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5318.532 ± 152.923 ns/op
[info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 79607.160 ± 651.779 ns/op
```
`Optimized HashTable.index (6cc1504)`:
```scala
[info] Benchmark (size) Mode Cnt Score Error Units
[info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 616.164 ± 4.712 ns/op
[info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2034.447 ± 14.495 ns/op
[info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 14712.164 ± 119.983 ns/op
[info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 679.046 ± 6.872 ns/op
[info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7242.097 ± 41.244 ns/op
[info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95342.919 ± 1521.328 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 488.034 ± 4.554 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 4883.123 ± 59.268 ns/op
[info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 65174.034 ± 496.759 ns/op
[info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 267.983 ± 1.797 ns/op
[info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5097.351 ± 104.538 ns/op
[info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 78772.540 ± 543.935 ns/op
```
Summary, i.e. the effect of this PR, according to the benchmarks:
* `groupBy` has a `~35%` speedup
* `get` didn't change
* `getOrElseUpdate` has a `~10%` speedup
* `put` has a `~3%` speedup
Note: caching the `exponent` to a local private field (`Byte` or `Int`) didn't have any performance advantage (only a minor slowdown was measured, possibly because it's accessed via an interface now)
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Don't exclude super calls to trait methods from inlining
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
In 8020cd6, the inliner was changed to make sure trait methods bodies
are not duplicated into the static super accessors, and from there into
mixin forwarders.
The check for mixin forwarders was too wide. In `def t = super.m`, where
`m` is a trait method annotated `@inline`, we want to inline `m`. Note
that `super.m` is translated to an `invokestatic T.m$`. The current
check incorrectly identifies `t` as a mixin forwarder, and skip
inlining.
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
SI-10009 Fields survive untypecheck/retypecheck
|