| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Should speak for itself.
Whenever someone changed @switch from an error to a warning,
it broke all the tests which depended on the error. I added
-Xfatal-warnings to a couple which needed it. And one of those
tests was then failing, as it must now since we couldn't get away
with what was being attempted, so I moved it to pending.
|
|
|
|
|
|
|
|
|
| |
Another in the category of bugs which involve narrowing,
widening, mediuming, dealiasing, weakening, normalizing,
denormalizing, supernormalizing, subnormalizing, and
double-bounded supersubnormalizing.
This is probably not the ideal fix, but it is an improvement.
|
|\
| |
| | |
Carve up Types.scala
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Step one of a plan to bring some order and thread
safety to this neck of the woods.
More info:
https://gist.github.com/retronym/5081754
https://groups.google.com/forum/?fromgroups=#!topic/scala-internals/MOvmcnbyb_g
Note that the sub package is named 'tpe' and not 'Types' to avoid
potential problems on case insensitive file systems, given the existing
trait 'Types.'
|
|\ \
| | |
| | | |
[rework] Modularized scaladoc and presentation compiler.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is the commit which brings it all together. The booleans
forInteractive and forScaladoc are now deprecated and are not
inspected for any purpose. All behavioral changes formerly
accomplished via tests of those flags are embodied in the globals
built specifically for those tasks.
|
| | |
| | |
| | |
| | |
| | | |
As with scaladoc, pushes presentation compiler specific
code into its separate source area.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This leverages the preceding several commits to push scaladoc
specific code into src/scaladoc. It also renders some scanner
code more comprehensible.
|
| | |
| | |
| | |
| | | |
% ant test.interactive
|
| | |
| | |
| | |
| | |
| | |
| | | |
Separate from (and larger than) pack.classpath. Then take
the opportunity to lower the comic/tragic level of duplication
in build.xml.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Some new partest abilities which were necessary to deal with
additional standard jars. These new abilities aren't yet put
to the test because scaladoc and interactive are still going
into the compiler jar.
No longer need each jar or classes directory be named
directly for partest to find them.
|
| | |
| | |
| | |
| | |
| | | |
As with the preceding commit, this has build-internal
effects only.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This change is not externally visible. It moves the scaladoc
sources into src/scaladoc and adds an ant target for building
them. The compilation products are still packaged into
scala-compiler.jar as before, but with a small change to
build.xml a separate jar can be created instead.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This is a non-behaviorally-changing setup commit which
re-routes bits of code through avenues which can more easily
be influenced by subclasses of Global.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There is no reason to be stability testing every piece of
bytecode we've ever encountered. If the compilation products
are unstable, then testing 20,000 classfiles will reveal it.
Or it won't; either way, we can stop there. So I cut a gordian
knot and focused the stability test solely on the contents of:
library reflect compiler
Next I cut the "custom ant task" cord. There's a tool for
diffing files, it's decades old, it's called diff. It does
the entire job we need. If it doesn't work on windows, it
doesn't matter. The stability test is not something which
needs to run in every environment. Either the classfiles
are stable or they aren't.
Generated the ant xml for building quick.{lib,reflect,comp}
and strap.{lib,reflect,comp} so they are identical modulo the
compiler used to build them, probably for the first time ever.
I'm sure they won't stay that way, but it's a step.
|
|\ \
| | |
| | | |
SI-7006 Fix the unreachable test
|
|/ /
| |
| |
| |
| | |
The unreachable test was missing the cases when Random.nextInt returned
a negative number. This commit fixes that.
|
|\ \
| | |
| | | |
SI-7231 Fix assertion when adapting Null type to Array type
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
GenICode was doing a sanity check when adapting an expression of type
Null to something else. It was just doing the wrong one. Instead of
checking whether the result expression type was a reference type it
was checking to see if it was an class reference type. This commit fixes
that and adds a test to make sure both forms of adaptation work as
expected.
|
|\ \ \
| |/ /
|/| | |
SI-7006 Prevent unreachable blocks in GenICode
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Minor cleanup from review of https://github.com/scala/scala/pull/2185
* Changed several instances of |= to ||= for better clarity (and bonus
savings!)
* Documented the return of two methods that compute the reachability
of follow-on blocks.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit makes GenICode prevent the generation of
most unreachable blocks. The new unreachable block prevention code can
be disabled with a compiler flag.
Because full unreachable analysis is no longer necessary for
normal code it makes the unreachable block analysis run only under
-optimise.
A test is included to make sure unreachable code doesn't cause issues
in code gen.
A concrete example will help.
def foo(): X = {
try
return something()
catch {
case e: Throwable =>
println(e)
throw e
}
unreachableCode()
]
Here unreachableCode() is unreachable but GenICode would create ICode
for it and then ASM would turn it into a pile of NOPS.
A previous commit added a reachability analysis step to eliminate
that unreachable code but that added a bit of time to the
compilation process even when optimization was turned off.
This commit avoids generating most unreachable
ICode in the first place so that full reachability analysis is
only needed after doing other optimization work.
The new code works by extending a mechanism that was already in place.
When GenICode encountered a THROW or RETURN it would put the
current block into "ignore" mode so that no further instructions
would be written into the block. However, that ignore mode flag
was itself ignored when it came to figuring out if follow on blocks
should be written. So this commit goes through places like try/catch
and if/else and uses the ignore mode of the current block to decide
whether to create follow on blocks, or if it already has, to kill by
putting them into ignore mode and closing them where they'll be
removed from the method's list of active blocks.
It's not quite as good as full reachability analysis. In particular
because a label def can be emitted before anything that jumps to it,
this simple logic is forced to leave label defs alone and that means
some of them may be unreachable without being removed. However, in
practice it gets close the the benefit of reachability analysis at
very nearly no cost.
|
|\ \ \
| |/ /
|/| | |
Merge 2.10.x into master
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Resurrect some undead code from 373ded2ad3 (tuple2Pickler).
Conflicts:
src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
|
| | |\ \
| | | | |
| | | | | |
SI-7214 outer check based on dealiased pattern type.
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-7109 SI-7153 Generalize the API to get docComments: allow to force do...
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
for given fragments. Don't type-check when forcing doc comments, but rather
do it directly. Test the new functionality as well as better tests for
the old one.
|
| |\| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
src/compiler/scala/tools/nsc/transform/patmat/Logic.scala
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
merge 2.10.1 into 2.10.x
|
| | | |\ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The fix for SI-7183 in 440bf0a8c2 was forward ported in f73d50f46c.
Conflicts:
src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
|
| | | | |\ \ \ \
| | | | | | | | |
| | | | | | | | | |
test.done again checks bin compat (using mima 0.1.5)
|
| | | | |\ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
[nomaster] SI-7195 minor version mustn't introduce warnings
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
This is a forward port of #2168 (originally for 2.10.1,
but the pattern matcher has since been refactored in 2.10.x.)
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| |\| | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Conflicts:
src/library/scala/collection/mutable/ArrayOps.scala
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
SI-7215 Fix transpose of an empty Array[Array[T]].
|
| | | | | | | | | | | |
|
| | |\ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
SI-7185 Avoid NPE in TreeInfo.isExprSafeToInline
|
| |\| | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
Conflicts:
src/compiler/scala/tools/nsc/transform/Erasure.scala
|
| | |\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | |
| | | | | | | | | | | | | |
SI-7190 macros no longer give rise to bridges
|
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | |
| | | | | | | | | | | | | |
Amazingly enough, this got through all the testing we performed. But now
erasure knows that it shouldn't generate bridges for macro methods.
|
| | | | | | | | | | | | | | |
| | \ \ \ \ \ \ \ \ \ \ \ | |
| |\ \ \ \ \ \ \ \ \ \ \ \ \
| | | |_|_|_|_|_|_|/ / / / /
| | |/| | | | | | | / / / /
| | | | |_|_|_|_|_|/ / / /
| | | |/| | | | | | | | | |
|
| | | | |_|_|_|_|/ / / /
| | | |/| | | | | | | | |
|
| | |/ / / / / / / / /
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
We want 2.10.1 to be a drop-in replacement for 2.10.0,
so we can't start warning where we weren't warning in 2.10.0.
See SI-5954 (#1882, #2079) for when it was an implementation restriction,
which was then weakened to a warning. It's now hidden behind -Ydebug.
|
| | |\ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
SI-7183 Disable unreachability for withFilter matches.
|
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
This avoids spurious unreachable warnings on code
that the user didn't write.
The parser desugars for-comprehensions such as:
for (A(a) <- List(new A)) yield a
To:
List(new A()).withFilter(((check$ifrefutable$2) =>
check$ifrefutable$2: @scala.unhecked match {
case A((a @ _)) => true
case _ => false
})
)
But, if `A.unapply` returns `Some[_]`, the last case is dead code.
(Matching against a regular case class *would* fall through in
the caes of a null scrutinee.)
In SI-6902, we enabled unreachability warnings, even if the
scrutinee was annotated as @unchecked. That was consistent
with the 2.9.2 behaviour, it was only disabled temporarily
(actually, accidentally) in 2.10.0. But, the old pattern matcher
didn't warn about this code.
This commit makes the pattern matcher recognise the special
scrutinee based on its name and disables both exhaustivity
*and* unreachability analysis.
To do so, the we generalize the boolean flag `unchecked` to
the class `Suppression`.
|
| | | | | | | | | | | | | |
| | \ \ \ \ \ \ \ \ \ \ | |
| | \ \ \ \ \ \ \ \ \ \ | |
| | \ \ \ \ \ \ \ \ \ \ | |
| | \ \ \ \ \ \ \ \ \ \ | |
| | \ \ \ \ \ \ \ \ \ \ | |
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | |/ / / / / / / / / /
| | | | |/| | | | / / / / / /
| | | | |_|_|_|_|/ / / / / /
| | | |/| | | | | | / / / /
| | | |_|_|_|_|_|_|/ / / /
| | |/| | | | | | | | / /
| | | | | | |_|_|_|_|/ /
| | | | | |/| | | | | /
| | |_|_|_|_|_|_|_|_|/
| |/| | | | | | | | | |
Fix check file for run/t7185.
|
| | | | | | |_|_|/ /
| | | | | |/| | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
A Typed Pattern (_: T) is more than `.isInstanceOf`: if `T` is a
path dependent type, the scrutinee's $outer reference is also
compared against the prefix of `T`.
The code that synthesises this is split into two places.
`needsOuterCheck` determines whether to add this check, based on
the type `T`, and the type of the scrutinee. If it gives the
go-ahead, `treeCondStrategy.outerCheck` synthesizes the check.
The new test case demonstrates the problems caused by the failure
to dealias in `needsOuterCheck`: it could either wrongly lead to
synthesis of an outer test (which would crash), or wrongly omit
the outer test (meaning overly liberal matching.)
A simple `dealias` remedies this. `dealiasWiden` is *not*
appropriate here; we need to keep hold of singleton types.
I'll also note that there is already a little slack between these
methods, as commented:
> ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix`
> by `Select(q, > outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix`
> if there's an outer accessor, otherwise the condition becomes `true`
> TODO: can we improve needsOuterTest so there's always an outerAccessor?
So this is probably a fragile area that warrants a careful review
with a view to design improvements.
|