| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- `def transform[S](f: Try[T] => Try[S])(implicit executor: ExecutionContext): Future[S]`
- `def transformWith[S](f: Try[T] => Future[S])(implicit executor: ExecutionContext): Future[S]`
- `def flatten[S](implicit ev: T <:< Future[S]): Future[S]`
- `def zipWith[U, R](that: Future[U])(f: (T, U) => R)(implicit executor: ExecutionContext): Future[R]`
Add missing utilities:
- `val unit: Future[Unit]` in `object Future`
- `object never extends Future[Nothing]` in `object Future`
- `def defaultBlockContext: BlockContext` in `object BlockContext`
- `def toString: String` on stdlib implementations of `Future`
Refactors:
- the `scala.concurrent.Future` trait to not explicit create any `Promises`,
so that implementations can control implementation type,
this is mainly facilitated through adding of the `transform` and `transformWith` methods.
- the implementation of `ExecutionContextImpl` has been cleaned up
- the `scala.concurrent.impl.DefaultPromise` has been reimplemented to not use `sun.misc.Unsafe`
Securing:
- Add a self-check in `completeWith` and `tryCompleteWith` to avoid cycles in trait Promise
- Capping the maximum number of threads for the global `ExecutionContext` to the max parallelism
- Implementing (almost) all `Future` combinators on `transformWith` and `transform` means
that `DefaultPromise` linking works on both `(flat)map` and `recover(With)`
- Nested `blocking {}` should not spawn extra threads beyond the first.
Removes:
- the private `internalExecutor` method in favor of an import in trait `Future`
- the private `internalExecutor` method in favor of an import in trait `Promise`
- the `AtomicReferenceFieldUpdater` in `AbstractPromise` since we're using `Unsafe`
- `scala.concurrent.impl.Future` is no longer needed
Deprecates:
- `Future.onSuccess` - discourage the use of callbacks
(and is also redundant considering `foreach` and `onComplete`)
- `Future.onFailure` - discourage the use of callbacks
(and is also redundant considering `onComplete` and `failed.foreach`)
- `ExecutionContext.prepare` - it was ill specced and it is too easy to forget to call it
(or even know when to call it or call it more times than needed)
- All classes in scala.concurrent.forkjoin. Scala 2.12 will be Java 8+ and as such the jsr166e
should be used as included in java.util.concurrent.
Reimplements:
- `failed` - in terms of `transform`
- `map` - in terms of `transform`
- `flatMap` - in terms of `transformWith`
- `recover` - in terms of `transform`
- `recoverWith` - in terms of `transformWith`
- `zip` - in terms of `flatMap` + `map`
- `fallbackTo` - in terms of `recoverWith` + `recoverWith`
- `andThen` - in terms of `transform`
Miscellaneous:
- Giving the threads of `ExecutionContext.global` sensible names
- Optimizes `object Future.successful` and `object Future.failed` are now separate implementations,
to optimize for the result, avoiding doing work for the "other branch".
- Optimizes `compressedRoot()` by avoiding double-calls to volatile get.
Documentation:
- Almost all methods on `Future` and `Promise` have been revisited and had their ScalaDoc updated
Tests:
- Yes
|
|\
| |
| |
| | |
merge/2.11.x-to-2.12.x-20140930
|
| |\
| | |
| | | |
Cleanup a few compiler flags in test/files/
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* String interpolation isn't Xexperimental anymore
A few useless Xexperimental flags in tests were left behind by 6917cca,
after string interpolation was made non-experimental in 983f414.
* things added under -Xfuture in 2.10 are very much Xpresent now, the
flag isn't needed anymore.
|
| |/
| |
| |
| |
| |
| | |
The check file used to contain a stack trace entry from
Predef with a line number. I've made the macro fail
in a different manner that avoids this fragility.
|
| |
| |
| |
| | |
Since .NET backend got removed this method is a no-op.
|
| |\
| | |
| | | |
SI-8459 fix incorrect positions for incomplete selection trees
|
| | |
| | |
| | |
| | |
| | |
| | | |
The mentioned issue is a presentation compiler issue, but its root cause is a bug in the parser which incorrectly assigned positions to incomplete selection trees (i.e. selections that lack an indentifier after dot and have some whitespace instead).
In detail: for such incomplete selection trees, the "point" of the position should be immediately after the dot but instead was at the start of next token after the dot. For range positions, this caused a pathological situation where the "point" was greater than the "end" of the position. This position is later used by the typechecker during resolution of dynamic calls and causes it to crash. Of course, because a syntactically incorrect code is required for the bug to manifest, it only happens in the presentation compiler.
|
| |\ \
| | | |
| | | | |
SI-8852 Support joint compilation of Java interfaces w. statics
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We had to change the java parser to accomodate this language
change in Java 8.
The enclosed test does not require JDK8 to run, it only tests
JavaParsers.
Here is a transcript of my manual testing using Java 8.
```
% tail test/files/run/8852b/{Interface.java,client.scala}
==> test/files/run/8852b/Interface.java <==
public interface Interface {
public static int staticMethod() {
return 42;
}
}
==> test/files/run/8852b/client.scala <==
object Test extends App {
assert(Interface.staticMethod() == 42)
}
// Under separate compilation, statics in interfaces were already working
% rm /tmp/*.class 2> /dev/null; javac -d /tmp test/files/run/8852b/Interface.java && scalac-hash v2.11.2 -classpath /tmp -d /tmp test/files/run/8852b/client.scala && scala-hash v2.11.2 -classpath /tmp -nc Test
// Under joint compilation, statics in interfaces now work.
% rm /tmp/*.class 2> /dev/null; qscalac -d /tmp test/files/run/8852b/{client.scala,Interface.java} && javac -d /tmp test/files/run/8852b/Interface.java && qscala -classpath /tmp -nc Test
```
|
| |\ \ \
| | |_|/
| |/| | |
This ensures that typechecking custom unapplications in silent mode
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
doesn't leak uncatchable errors. Interestingly enough, the problem
only manifested itself for custom unapply methods, not for synthetic
ones generated for case classes.
|
| |\ \ \
| | |_|/
| |/| | |
SI-8844 Fix regression with existentials + type aliases
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Regressed in 2a1b15e / SI-8283. Another specimen of an archetypal
bug: unwanted dealising by using `typeSymbol`, rather than
`typeSymbolDirect`.
|
|\| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
merge/2.11.x-to-2.12.x-20140917
Conflicts:
build.xml
The merge conflict was centred around the introduction of
the build property `test.bc.skip`, and was straight forward
to resolve.
|
| |\ \ \
| | | | |
| | | | | |
SI-8680 Stream.addString is too eager
|
| | | |/
| | |/|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Used the standard method of sending out two iterators, one twice as fast as the others, to avoid hanging on .force, .hasDefiniteSize, and .addString.
.addString appends a "..." as the last element if it detects a cycle. It knows how to print the cycle length, but there's no good way to specify what you want right now, so it's not used.
Added tests in t8680 that verify that cyclic streams give the expected results.
Added to whitelist names of methods formerly used for recursion (now looping).
|
| |\ \ \
| | | | |
| | | | | |
SI-8815 mutable.LongMap makes different choices for splitAt vs etc.
|
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
It turns out that take/drop/splitAt/takeWhile/dropWhile inherit a smattering of foreach vs. iterator-based implementations. These aren't consistent unless they iterate in the same order. This probably reflects an undesirable underlying weakness, but in this particular case it was easy to make LongMap's foreach order agree with iterator.
Made traversal order of other foreach-like methods match also.
Also fixed a bug where Long.MinValue wasn't iterated.
Added unit test for iteration coverage of extreme values.
|
| |\ \ \
| | | | |
| | | | | |
SI-8806 Add lower bound check to Any lint
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We already exclude the lint check for infer-any if
Any is somewhere explicit.
This commit adds lower bounds of type params to
the somewheres.
Motivated by:
```
scala> f"${42}"
<console>:8: warning: a type was inferred to be `Any`; this may indicate a programming error.
f"${42}"
^
res0: String = 42
```
|
| |\ \ \ \
| | | | | |
| | | | | | |
isAnonymousClass/Function for delambdafy classes is not true
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Ydelambdafy:method lambda classes are not anonymous classes, and not
anonymous function classes either. They are somethig new, so there's
a new predicate isDelambdafyFunction.
They are not anonymous classes (or functions) because anonymous
classes in Java speak are nested. Delambdafy classes are always
top-level, they are just synthetic.
Before this patch, isAnonymous was sometimes accidentailly true: if
the lambda is nested in an anonymous class. Now it's always false.
|
| |\ \ \ \ \
| | |_|_|/ /
| |/| | | | |
GenBCode: eliminate unreachable code
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is required for correctness of the generated bytecode. Exception
handlers and local variable descriptors specify code offset ranges.
These offsets have to exist, not be eliminated.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Tests for emitting expressions of type Nothing.
|
| | | | | | |
|
| | |/ / /
| | | | |
| | | | |
| | | | | |
JUnit tests may use tools from partest-extras (ASMConverters)
|
|\| | | | |
|
| |/ / /
| | | |
| | | |
| | | | |
Compiler internals treat lazy vals as methods. Therefore, we need to have a special case for them when assembling the warning message.
|
| |\ \ \
| | | | |
| | | | | |
SI-8764 fix return type of case class productElement under Xexperimental
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Xexperimental
Under Xexperimental, productElement now returns the lub instead
of the weak lub of case class parameter types (numeric widening
shouldn't magically happen *inside* productElement).
This was removed from 2.12.x in 6317ae2.
|
|\| | | | |
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-5254 running an empty scala script should succeed
|
| | | |/ /
| | |/| |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The script runner made the assumption that "compilation succeeded"
implies "there is a Main class to run", but this can be wrong if the
script is empty (or only contains imports/comments).
The ScriptRunner now uses the ClassPath utility to check if there really
is a main class. If not, it doesn't try to run it and returns
peacefully. This also makes `scala -e ''` succeed.
|
| |\ \ \ \
| | |_|_|/
| |/| | | |
-Ystatistics accepts a list of phases for which to print stats
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is pretty easy, since a ValueSet is a BitSet.
When the setting is updated, recompute the current
set of values, which is cheap and succinct.
Checking a flag is also easy and fast.
Choices in MultiChoiceSettings may enable other choices.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
MultiChoiceSetting and Xlint with its deprecated aliases is now a bit
simpler, but there's still room for improvement, as noted in comments.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The test in StdNamesTest was introduced in cff8b569, where newTermName
would throw on a negative length. In b090f97 this was changed to fix
the negative length, but the test was not adapted (as it didn't fail).
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-8803 generate super accessor for super[A], if A is outer superclass
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
class C extends A with T {
class I {
C.super[T]
C.super[A]
}
}
A super call in a nested class of the form super[T] where T is a
parent trait of the outer class doesn't need an accessor: mixin can
directly re-route the call to the correct implementation class - it's
statically known to be T$class.
However, if a nested class accesses super[A] and A is the superclass
of the outer class (not a trait), then we need a super accessor in the
outer class.
We need to add the mixin name to the super accessor name, otherwise
it clashes with non-qualified super accessors.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8786 disable part of thest that's failing the jdk8 build
|
| | | | | | | |
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8498 @compileTimeOnly should be aware of bridge methods.
|
| | | |/ / / /
| | |/| | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Calling a @compileTimeOnly method from another @compileTimeOnly
method happens when the former gets a bridge method. It should not
throw an error. Calling the bridge or the method will anyway.
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
scaladoc: fixed code block indentation normalization
|
| | | | | | | | |
|