| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Removed class files.
|
|/
|
|
| |
Someone checked in a pair of .class files.
|
|\
| |
| | |
SI-6942 more efficient CNF conversion in patmat analysis
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Avoid blowing the stack/the analysis budget by more eagerly translating
the propositions that model matches to CNF.
First building a large proposition that represents the match,
and then converting to CNF tends to blow the stack.
Luckily, it's easy to convert to CNF as we go.
The optimization relies on `CNF(P1 /\ ... /\ PN) == CNF(P1) ++ CNF(...) ++ CNF(PN)`:
Normalizing a conjunction of propositions
yields the same formula as
concatenating the normalized conjuncts.
CNF conversion is expensive for large propositions,
so we push it down into the conjunction and
then concatenate the resulting arrays of clauses (which is cheap).
(CNF converts a free-form proposition into an `Array[Set[Lit]]`, where:
- the Array's elements are /\'ed together;
- and the Set's elements are \/'ed;
- a Lit is a possibly negated variable.)
NOTE:
- removeVarEq may throw an AnalysisBudget.Exception
- also reworked the interface used to build formula,
so that we can more easily plug in SAT4J when the time comes
|
|\ \
| |/
|/| |
SI-5568 Fixes verify error from getClass on refinement of value type
|
| |
| |
| |
| |
| | |
Based on code review here are a few comment cleanups and the removal of
some dead test code.
|
| |
| |
| |
| |
| |
| |
| |
| | |
().asInstanceOf[AnyRef with Unit].getClass and
5.asInstanceOf[AnyRef with Int].getClass would cause a verify
error. Going the other way, i.e. [Unit with AnyRef] or [Int with AnyRef]
worked fine. This commit fixes it that both directions work out to
BoxedUnit or java.lang.Integer.
|
|\ \
| | |
| | | |
SI-6601 Publicise derived value contstructor after pickler
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Otherwise the access restrictions are not enforced under
separate compilation.
See also SI-6608.
|
|\ \ \
| | | |
| | | | |
SI-6923 Context now buffers warnings as well as errors
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Code that was silently typed would not report warnings, even if it
returned a successful result.
This appeared in the following code which didn't show warnings even
with -Ywarn-adapted-args:
def foo(a: Any) = a; foo(1, 2)
While the following would show the expected warning:
def foo[A](a: Any) = a; foo(1, 2)
|
|\ \ \
| | | |
| | | | |
SI-6956 determine switchability by type, not tree
|
| | | | |
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Constant folding will set the type of a constant tree
to `ConstantType(Constant(folded))`, while the tree
itself can be many different things (in casu, an Ident).
We used to look at the tree directly when deciding whether
to emit a switch. Now we look at the tree's type. Voilà.
|
|\ \ \
| |/ /
|/| | |
SI-6479 Don't lift try exprs in label arguments.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new pattern matcher uses label jumps to GOTO
the next case. Uncurry treated these like regular
method arguments, and performed the liftedTree()
transformation, which ensures that try expressions
are only used in a statement position. Even try
in statement position of a block used as such an argument
are subject to the same transform.
This transform stems from the JVM limitation,
that try/catch does not leave a value on the stack.
See b194446.
This commit changes Uncurry to avoid this transform
for arguments to label jumps. This avoids needlessly
indirect code, and enables tail call elimination in
more cases.
As an example, Scala 2.10.0 transforms the last
method of the enclosed test case to:
try {
case <synthetic> val x1: Int = 1;
case5(){
if (2.==(x1))
{
val x2: Int = x1;
matchEnd4({
{
def liftedTree2(): Unit = try {
throw new scala.runtime.NonLocalReturnControl[Unit](nonLocalReturnKey1, ())
} catch {
case (e @ (_: ClassNotFoundException)) => ()
};
liftedTree2()
};
TailrecAfterTryCatch.this.bad()
})
}
else
case6()
};
case6(){
matchEnd4(throw new MatchError(x1))
};
matchEnd4(x: Unit){
x
}
} catch {
case (ex @ (_: scala.runtime.NonLocalReturnControl[Unit @unchecked])) => if (ex.key().eq(nonLocalReturnKey1))
ex.value()
else
throw ex
}
After this patch:
@scala.annotation.tailrec final def bad(): Unit = {
case <synthetic> val x1: Int = 1;
case5(){
if (2.==(x1))
{
<synthetic> val x2: Int = x1;
matchEnd4({
try {
return ()
} catch {
case (e @ (_: ClassNotFoundException)) => ()
};
TailrecAfterTryCatch.this.bad()
})
}
else
case6()
};
case6(){
matchEnd4(throw new MatchError(x1))
};
matchEnd4(x: Unit){
x
}
}
|
|\ \ \
| | | |
| | | | |
SI-6963 Deprecates -Xmigration switch
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
-Xmigration is specific to the 2.7 to 2.8 upgrade and is no longer
relevant. There is no plan to maintain it so it will be removed. This
commit deprecates it in anticipation.
|
|\ \ \
| | | |
| | | | |
SI-6675 -Xlint arity enforcement for extractors
|
| | | |
| | | |
| | | |
| | | | |
This commit should be discarded when merging to master.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Extractor Patterns changed in 2.10.0 to implement
the letter of the spec, which allows a single binding
to capture an entire TupleN. But this can hide arity
mismatches, especially if the case body uses the
bound value as an `Any`.
This change warns when this happens under -Xlint.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6955 switch emission no longer foiled by type alias
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
dealias the type of the scrutinee before checking it's switchable
now with tests! (using IcodeTest since javap is not available everywhere)
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6082 Conditionally expand @ann(x) to @ann(value = x)
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
... if the annotation has an argument with the name `value`.
Doing so unconditionally obscures error messages.
We still require that arguments to ClassFileAnnotations
are named, other than for this special case.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5440 Test case for exhaustiveness check
|
| | |_|/ /
| |/| | |
| | | | |
| | | | | |
Reported against patmatclassic, working in virtpatmat.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5340 Change println to log
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
An esoteric implicit search could trigger an "amb prefix ..."
message to standard out. Now the message has been improved
and sent to the logger.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6925 use concrete type in applyOrElse's match's selecto
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
implement the following review comments by @retronym:
- [x] Please clothe this naked assert.
- [x] Use match to dissect targs and check isFullyDefined.
- [x] Instead of `targs.head`/`targs.last`, use `val argTp :: resTp :: Nil = targs`.
- [x] Add a quasi-quote-style comment for `apply`.
- [x] Factor out mkCastPreservingAnnotations.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
no behavioral changes, just highly overdue cleanup
some TODOs for further improvements
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fix a regression introduced in 28483739c3:
PartialFunction synthesis was broken so that we'd get:
```
scala> def f[T](xs: Set[T]) = xs collect { case x => x }
f: [T](xs: Set[T])scala.collection.immutable.Set[_ <: T]
```
rather than
```
scala> def f[T](xs: Set[T]) = xs collect { case x => x }
f: [T](xs: Set[T])scala.collection.immutable.Set[T]
```
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5189 detect unsoundness when inferring type of match
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
GADT skolems encode type slack that results from pattern matching on variant type constructors
I thought they would not longer be relevant after cases have been typed,
and since they caused weird issues with the old pattern matcher, I deskolemized in typedCase
however, when we don't have an expected type for the match, we need to keep the skolems around
until the skolemized type makes it out of the match and it becomes the result of type inference for that match
when you do have an expected type, it will propagate to the case-level and the confrontation will thus
already take place when typing individual cases
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6555 Scaladoc's class filter shouldn't drop the last character (2.10.x)
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | | |
The event handler have to wait "keyup", not "keydown".
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6930 adds documentation to reduceLeft in TraversableOnce
|
| | |/ / / /
| |/| | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6594 - Switch to sneakyThrows instead of Unsafe.throwException as per...
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
jsr166y to avoid issues with Android
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6126 Test case for varargs of tagged primitives.
|
| | |_|_|_|/ /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This started working after the merge fe1110f. I didn't track
down precisely which commit was responsible beyond that.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6946, SI-6924 Greatly improves IsTraversableLike docs
|
| | |_|_|/ / /
| |/| | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-5954 Adds implementation restriction preventing companions in package...
|
| | |/ / / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Companion objects (and thus also case classes) in package objects caused
an assert about an overloaded symbol when everything was compiled twice.
It's a hairy problem that doesn't fit in 2.10.1. So this fix adds an
implementation restriction. It also has a test to make sure the error
messages are clean and reasonably friendly, and does not catch other
things defined in package objects. The test includes a
commented out test in case somebody thinks they've solved the underlying
problem.
A handful of tests were falling afoul of the new implementation
restriction. I verified that they do in fact fail on second compile so
they aren't false casualties. But they do test real things we'd like
to work once the re-compile issue is fixed. So I added a -X flag to
disable the implementation restriction and made all the tests
accidentally clobbered by the restriction use that flag.
|