| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Add tests for ConsoleReporter.
|
| | |
|
|\ \
| |/
|/| |
SI-10187 Support mutation of mutable.HashMap in getOrElseUpdate
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Scala 2.12.1 included optimizations to `HashMape.getOrElseUpdate`
to avoid recomputing the index in the hash table when adding an
the element.
However, this index could be stale if the callback added elements
to the map and triggered a resize.
This commit checks that the table is unchanged before reusing
the index, restoring the 2.12.0 behaviour.
|
| |
| |
| |
| |
| |
| | |
these were occasionally timing out on our Windows CI
reference: https://github.com/scala/scala-dev/issues/313
|
| | |
|
|\ \
| | |
| | | |
SI-9881 Fix ImportHandler's reporting of importedNames and importedSymbols
|
| | | |
|
|\ \ \
| | | |
| | | | |
SI-10133 Require escaped single quote char lit
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Instead of indenting source code to make messages
align on output, let the reporter add indentation,
only if the source is the console (and not a pastie
or a loaded file).
Previously, syntax errors were not indented.
```
$ skala
Welcome to Scala 2.12.2-20170108-010722-939abf1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.
scala> 'abc'
<console>:1: error: unclosed character literal (or use " for string literal "abc")
'abc'
^
scala> :quit
$ scala
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.
scala> 'abc'
<console>:1: error: unclosed character literal
'abc'
^
```
|
|\ \ \ \
| |_|_|/
|/| | | |
Faster and simpler Java 9 classpath implementation
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- Take advantage of the `/packages` index provided by the
jrt file system to avoid (expensive) Files.exist for
non-existent entries across the full list of modules.
- Extends ClassPath directly which leads to a simpler
implemnentation that using the base class.
- Add a unit test that shows we can read classes and packages
from the Java standard library.
Fixes scala/scala-dev#306
With this change bootstrap time under Java 9 was comparable to
Java 8. Before, it was about 40% slower.
|
|\ \ \ \ |
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-10164 BitSet.tail zigs where it zagged
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | | |
A cut/paste issue, an increment was held over from head,
which scans forward, to tail, which scans backward.
|
| |\ \ \ \
| | |/ / /
| |/| | | |
SI-10177 Override lazy operations to preserve TrieMap's semantics
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Calling .iterator on a TrieMap gives a read-only snapshot. This then
extends to most inherited implementations written in terms of .iterator.
However, some inherited methods, such as .values, either defer the call
to .iterator or call it more than once. This results in subsequent
mutations to the original map being visible
I reviewed the inherited implementations from MapLike and found we
needed overrides of `values`, `keySet`, `filterKeys`, and `mapValues`.
Like `iterator`, these now create a read-only snapshot.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
follows up on https://github.com/scala/scala/pull/5664;
fixes https://github.com/scala/scala-dev/issues/301
|
| | | | |
| | | | |
| | | | |
| | | | | |
Specifically, the `slice` and `take` methods.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As they're reusable in 2.12.x with this change[1], it'd be useful
to make them reusable in 2.11.x.
[1] https://github.com/scala/scala/commit/6eaae1b969b68ed3dc65a40613a8168b09246256
With this change, not only are they reusable but also we can avoid
mutation of previously created arrays.
Behaviour(Problem):
Actual behaviour before this modification is as follows;
<ArrayBuilder>
```
scala> import scala.collection.mutable.ArrayBuilder
import scala.collection.mutable.ArrayBuilder
scala> val builder = new ArrayBuilder.ofInt
builder: scala.collection.mutable.ArrayBuilder.ofInt = ArrayBuilder.ofInt
scala> builder ++= Vector.range(1, 17)
res0: builder.type = ArrayBuilder.ofInt
scala> val arr = builder.result()
arr: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
scala> builder.clear()
scala> builder += 100
res2: builder.type = ArrayBuilder.ofInt
scala> val arr2 = builder.result()
arr2: Array[Int] = Array(100)
scala> arr
res3: Array[Int] = Array(100, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
// arr should be Array(1, .., 16) but was unexpectedly mutated by `+=` operation
```
`arr` was mutated as follows;
1. `result` & `clear`
- `arr = elems`
- `size = 0`
2. `+=(100)`
- `ensureSize(0 + 1)`
=> `capacity < size || capacity == 0` is `false` as `capacity == 16`
and `size == 1`
- `elems(0) = 100` this is where `arr(0) = 100` was done because we
did not reallocate a new array for `elems` when calling `ensureSize`,
which should have happened.
- `size = 1`
3. `result`
- `mkArray(1)` gives us `arr2 = Array(100)`
<WrappedArrayBuilder>
We can observe almost the same mutation behaviour of ArrayBuilder.
```
scala> import scala.collection.mutable.WrappedArray
import scala.collection.mutable.WrappedArray
scala> import scala.collection.mutable.WrappedArrayBuilder
import scala.collection.mutable.WrappedArrayBuilder
scala> import scala.reflect.ClassTag
import scala.reflect.ClassTag
scala> val builder = new WrappedArrayBuilder(ClassTag.Int)
builder: scala.collection.mutable.WrappedArrayBuilder[Int] = scala.collection.mutable.WrappedArrayBuilder@56cbfb61
scala> builder ++= Vector.range(1, 17)
res0: builder.type = scala.collection.mutable.WrappedArrayBuilder@56cbfb61
scala> builder.result()
res1: scala.collection.mutable.WrappedArray[Int] = WrappedArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
scala> builder.clear()
scala> builder += 100
res3: builder.type = scala.collection.mutable.WrappedArrayBuilder@56cbfb61
scala> res1
res4: scala.collection.mutable.WrappedArray[Int] = WrappedArray(100, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
scala> builder.result()
res5: scala.collection.mutable.WrappedArray[Int] = WrappedArray(100)
```
Solution:
We should reset `capacity` to `0` when calling `result` so that
`ensureSize(1)` calls `resize(16)`, which satisfies the property of Builder
reusability. Besides mutation of previously created arrays does not happen.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-9507 Make Stream #:: and #::: allow type widening
|
| | |/ / /
| |/| | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
SI-10097 Error if no non-implicit case class param
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Case class must have a non-implicit param list.
Error early, error often.
Also update spec to say that class implicitly gets
a non-implicit parameter section if it doesn't
have one, and that a case class must have one.
|
| |_|_|/
|/| | |
| | | |
| | | | |
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.
|
|\ \ \ \
| |_|/ /
|/| | /
| | |/
| |/|
| | |
| | |
| | |
| | |
| | | |
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-10086 NumericRange.min|max with custom Integral
|
|\ \ \
| |_|/
|/| | |
SI-10060 Fixes NumricRange.max bug on empty ranges
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | |/
| |/|
| | |
| | |
| | |
| | |
| | | |
Conflicts:
spec/_layouts/default.yml
test/junit/scala/tools/nsc/interpreter/CompletionTest.scala
Fixes scala/scala-dev#272
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The code used to fuzzily match, e.g, `declasses` with `getDeclaredClasses`
was exploring fruitless parts of the search space. The enclosed test
case was hanging the REPL.
This commit improves this by performing a prefix match of the unconsumed input
against the current chunk of the candidate before exploring the `inits`.
Fixes scala/scala-dev#271
|
|\ \ \
| | | |
| | | | |
SI-8779 Enable inlining of code within a REPL session
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The REPL has a long running instance of Global which outputs
classfiles by default to a VirtualDirectory. The inliner did not find
any of these class files when compiling calls to methods defined in
previous runs (ie, previous lines of input.)
This commit:
- Adds a hook to augment the classpath that the optimizer searches,
and uses this in the REPL to add the output directory
- Fixes the implementation of `findClassFile` in VirtualDirectory,
which doesn't seem to have been used in anger before. I've factored out
some common code into a new method on `AbstractFile`.
- Fixes a similar problem getSubDir reported by Li Haoyi
- Adds missing unit test coverage.
This also fixes a bug in REPL autocompletion for types defined
in packages >= 2 level deep (with the `:paste -raw` command).
I've added a test for this case.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Some changes to the trait encoding came late in the 2.12 cycle, and the
inliner was not adapted to support it in the best possible way.
In 2.12.0 concrete trait methods are encoded as
interface T {
default int m() { return 1 }
static int m$(T $this) { <invokespecial $this.m()> }
}
class C implements T {
public int m() { return T.m$(this) }
}
If a trait method is selected for inlining, the 2.12.0 inliner would
copy its body into the static super accessor `T.m$`, and from there into
the mixin forwarder `C.m`.
This commit special-cases the inliner:
- We don't inline into static super accessors and mixin forwarders.
- Insted, when inlining an invocation of a mixin forwarder, the
inliner also follows through the two forwarders and inlines the
trait method body.
There was a difficulty implementing this: inlining the static static
super accessor would copy an `invokespecial` instruction into a
different classfile, which is not legal / may change semantics. That
`invokespecial` is supposed to disappear when inlining the actual
default method body. However, this last step may fail, for example
because the trait method body itself contains instructions that are not
legal in a different classfile.
It is very difficult to perform all necessary checks ahead of time. So
instead, this commit implements the ability to speculatively inline a
callsite and roll back if necessary.
The commit also cleans up the implementation of inliner warnings a
little. The previous code would always emit a warning when a method
annotated `@inline` was not picked by the heuristics - this was a
problem when the callsite in the static super accessor was no longer
chosen.
|
|\ \ \
| | | |
| | | | |
SI-10007 sys.process thread sync
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
A previous change to replace `SyncVar.set` with `SyncVar.put`
breaks things.
This commit tweaks the thread synchronizing in `sys.process`
to actually use `SyncVar` to sync and pass a var.
Joining the thread about to exit is superfluous.
A result is put exactly once, and consumers use
non-destructive `get`.
Note that as usual, avoid kicking off threads in a static
context, since class loading cycles are somewhat dicier
with 2.12 lambdas. In particular, REPL is a static context
by default.
SI-10007 Clarify deprecation message
The message on `set` was self-fulfilling, as it didn't
hint that `put` has different semantics.
So explain why `put` helps avoid errors instead of
creating them.
SI-10007 Always set exit value
Always put a value to exit code, defaulting to None.
Also clean up around tuple change to unfortunately
named Future.apply. Very hard to follow those types.
Date command pollutes output, so tweak test.
|
|\ \ \ \
| | | | |
| | | | | |
SI-9885 Don't return offset past EOF
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
On bad line number, `lineToOffset` should not return
an offset past EOF (which was sentinel, internally).
|
| |_|_|/
|/| | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit 656162bb48fbbd703790a2c94d4563e40ddfdfc2.
Adding new APIs is not possible until a major release.
|
|\ \ \ \
| | | | |
| | | | | |
SI-9888. Prevent OOM on ParRange. Improve toString.
|
| | | | | |
|
|\ \ \ \ \
| |_|_|/ /
|/| | | /
| | |_|/
| |/| | |
|
| |\ \ \
| | | | |
| | | | | |
SI-9913 Lead span iterator finishes at state -1
|