| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Use the same default scalac options in all three partest frontends
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make ConsoleRunner, AntRunner and SBTRunner take scalac options from
"partest.scalac_opts" property.
Also remove leftover "-deprecation" option from test/partest.
The change to SBTRunner was not tested as sbt test is currently broken.
|
|\ \
| | |
| | | |
[backport] Fix SI-6637 (misoptimization in erasure)
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
commit f9ef5300ab561628e53c654df9000c75f488d74a
Author: Jan Niehusmann <jan@gondor.com>
Date: Fri Nov 9 15:05:58 2012 +0100
Fix SI-6637 (misoptimization in erasure)
Move the optimization one level deeper so the expression
being tested with isInstanceOf is always evaluated.
(cherry picked from commit b540aaee4ba30e2dd980456a44e8c6d732222df1)
|
|\ \
| | |
| | | |
[backport] Fix unsafe array opt. / opt. primitive Array(...)
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
SI-6611, SI-6247 (partial fix)
The original commits on master were a bit circuitous, this
is squashed to a neat little package.
I had to add type arguments to the Array.apply calls in the
test case, they are inferred on master.
commit 41ff05dfdbcf032157b3509ace633f2e7a12295c
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Sun Nov 4 14:44:59 2012 +0100
Refactor guards checking for a particular overload of Array.apply.
(cherry picked from commit 092345a24c22a821204fb358d33272ae8f7353be)
commit 1e5c942deccaf64f8d57bd8891b912381d7f220a
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Sun Nov 4 14:17:25 2012 +0100
Expand optimization of Array(e1, ..., en) to primitive arrays.
(cherry picked from commit 8265175ecc42293997d59049f430396c77a2b891)
commit ab1bf77e39f2dfeacf3fc107ccb2907a1867f04c
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Sat Nov 3 13:34:20 2012 +0100
SI-6611 Tighten up an unsafe array optimization
The net was cast too wide and was unsafely optimizing away array
copies.
(cherry picked from commit dad886659faca4fba2d4937c9bc6780591b02c27)
And also:
Optimize primitive Array(e1, ..., en)
Expands an existing optimization for reference arrays to
apply to primitives, as well.
Fixes one aspect of SI-6247.
(cherry picked from commit cac5a08611f9511ba4d94b99db630404efae190a)
Conflicts:
src/compiler/scala/tools/nsc/transform/CleanUp.scala
More principled tree copying.
Canonical > home-spun.
Conflicts:
src/compiler/scala/tools/nsc/transform/CleanUp.scala
|
|\ \
| | |
| | | |
[backport] SI-6567 Warning for Option(implicitView(foo))
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
commit 284bd754fa5dfc8bc626b0c5ebe85d872dd044cb
Author: Jason Zaugg <jzaugg@gmail.com>
Date: Sat Nov 3 16:19:46 2012 +0100
SI-6567 Warning for Option(implicitView(foo))
I've seen the reported problem before in the wild. It seems
worthy of a special warning, so long as we advocate Option.apply
as an alternative to `if (x == null) Some(x) else None`.
It is behind -Xlint at the moment, an option that could do with
some promotion.
(cherry picked from commit 0bcb9e9169146e3f589c6c9f65cc4a5523b78120)
|
|\ \
| | |
| | | |
SI-6439 Avoid spurious REPL warnings about companionship
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`val m` isn't a companion of `trait m`, check the pair of
eponymous symbols are a ((class|trait), object) pair before
emitting the warning.
In order to correctly check this one a type alias is involved,
`definedSymbols` must avoid normalizing through type aliases.
AFAICT this is an improvement to the other clients of that Map,
one such power mode progression is demonstrated at the end
of the test case.
|
|\ \ \
| | | |
| | | | |
Addressing warnings.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
- SI-6923 uncovered a few valid warnings, these have been
addressed.
- A pair of "catches all throwable" warnings appeared; one
of the is spurious and the subject of SI-6994.
|
|\ \ \
| | | |
| | | | |
SI-6994 Avoid spurious promiscuous catch warning
|
| |/ /
| | |
| | |
| | |
| | | |
It was being issued upon re-typechecking of a transformed
tree. Now we disable the warning post-typer.
|
|\ \ \
| | | |
| | | | |
Fix broken build.
|
|/ / /
| | |
| | |
| | | |
It's all system admin, all the time, here at scala ranch.
|
|\ \ \
| |_|/
|/| | |
SI-6434 Pretty print function types with by name arg as (=> A) => B
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
We were pretty printing a function type with one by name arg as
=> A => B, but because => is right associative that's formally
equivalent to => (A => B) and that's entirely a different thing. This
commit changes the pretty printer in Typers.scala to check for a
byname argument on a function type and wrap it in parens. A REPL test
is included.
|
|\ \
| | |
| | | |
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.
|