| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
For not passing on java6.
|
|\
| |
| | |
a painstaking examination of Variance
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As the comment says:
Not enough to look for abstract types; have to recursively check
the bounds of each abstract type for more abstract types. Almost
certainly there are other exploitable type soundness bugs which
can be seen by bounding a type parameter by an abstract type which
itself is bounded by an abstract type.
SPECIAL: BUY ONE UNSOUNDNESS, GET ONE FREE
In refinement types, only the first parameter list of methods
was being analyzed for unsound uses of abstract types. Second
parameter list and beyond had free unsoundness reign. That bug
as well is fixed here.
|
| |
| |
| |
| |
| |
| |
| | |
This wasn't as bad as it could have been. All these changes
plug soundness holes in trunk. Mostly we're looking at type
aliases which were merely protected when they had to be
protected[this] not to allow unsound variance crossover.
|
| | |
|
|\ \
| |/
|/| |
Repl javap decodes various synthetic names for us (fixing SI-6894)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For instance, javap -app Test is equivalent to javap Test$delayedInit$App
with the correct line and iw prepended. This works by taking Test as a
name in scope, translating that, and then supplying the suffix.
Then javap -fun Test shows Test$$anonfun*, and for member m,
javap -fun Test#m shows Test$$anonfun$$m*.
This also works for classes and values defined in the repl.
javap -fun -raw m shows $line3.$read$$iw$$iw$$anonfun$m$1.
E.g., javap -fun scala.Enumeration obviates knowing or guessing
scala/Enumeration$$anonfun$scala$Enumeration$$populateNameMap$1.class.
Also, scala> :javap -fun scala.Array#concat
but still to do is using imported syms.
Both files and replout are supported for searching for artifacts.
The trigger is detecting the synthetic name (has an interior dollar).
Still to do, filter the output on Test#m to show only m.
Need a way to explore the list of artifacts; ideally, related symbols
would be available reflectively.
Prefer companion class to object, otherwise it's not showable;
for object, require dollar when both exist.
A JavapTest is supplied that is a ReplTest that asserts something about
its output instead of printing it.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Patches applied:
- rename of `dropRepeatedParamType` to `dropIllegalStarTypes` -- required since 8886d22cd6
- fixed test/files/neg/t6406-regextract.flags -- how could this have worked before?
Conflicts:
src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala
src/library/scala/collection/LinearSeqOptimized.scala
src/library/scala/util/Properties.scala
test/files/run/streams.check
test/files/run/streams.scala
|
| |\ \
| | | |
| | | | |
SI-6897, lubs and varargs star.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Don't allow lubs to calculate refinement types which contain
a varargs star outside of legal varargs star position.
|
| |\ \ \
| | | | |
| | | | | |
SI-6896, spurious warning with overloaded main.
|
| | |/ /
| | | |
| | | |
| | | |
| | | | |
Make sure there's no legit main signature before issuing
any warnings about missing main methods.
|
| |\ \ \
| | | | |
| | | | | |
SI-6911, regression in generated case class equality.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Caught out by the different semantics of isInstanceOf and
pattern matching.
trait K { case class CC(name: String) }
object Foo extends K
object Bar extends K
Foo.CC("a") == Bar.CC("a")
That expression is supposed to be false, and with this
commit it is once again.
|
| |\ \ \ \
| | | | | |
| | | | | | |
Fix Iterator#copyToArray (fixes SI-6827).
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As pointed out in #scala, when using a non-zero start it's possible
to get an ArrayIndexOutOfBoundsException due to an incorrect bounds
check. This patch fixes this, as well as another potential bounds
error, and adds test cases.
Incorporates some other suggestions by Som-Snytt to ensure that
callers will get useful error messages in cases where the start
parameter is wrong (negative or out-of-array-bounds).
Review by @som-snytt.
|
| |\ \ \ \
| | |/ / /
| |/| | | |
SI-5017 Poor performance of :+ operator on Arrays
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Control performance of :+ and +: operator on my machine were 700-800 ms
After adding size hint on the implementation in SeqLike, it went down to 500-600 ms
But with specialixed implementation in ArrayOps, brings it down to 300-400 ms
Unfortunatly, this method will only be called when the Array object is being referenced directly as it's type, but that should be the case enough times to justify the extra method.
I ended up removing the sizeHint in SeqLike because it made the execution of the "benchmark" slower when the Array was being manipulated as a Seq.
Side note: Interestingly enough, the benchmark performed better on my virtualized Fedora 17 with JDK 7 than natively on Mac OS X with JDK 6
|
| |\ \ \ \
| | |_|/ /
| |/| | | |
SI-6194, repl crash.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Always a bad idea to use replaceAll on unknown strings,
as we saw here when windows classpaths arrived containing
escape-requiring backslashes.
|
| |\ \ \ \
| | | | | |
| | | | | | |
Remove -deprecation from partest default options.
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Who knows why it was ever like this; it's not like anyone
sees the deprecation warnings. In PR #1807 there is now a
test which depends on partest not making this move, so it's
a good time to finally expunge it.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Had to fix up an iffy test: not only was it testing undefined
behavior, it demanded just the right numbers be printed in a
context where all negative or positive numbers are equivalent.
It's the ol' "get them coming and going" trick.
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The lengthCompare method in LinearSeqOptimized was looking one
step further than it needed to in order to give the correct
result, which was creating some unwanted side effects related to
Streams.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Have to intercept trees which have a null type due to errors
before they leave the warm confines of 'def typed' because from
that point everything assumes tree.tpe != null.
|
|\ \ \ \
| | | | |
| | | | | |
adds c.introduceTopLevel
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The first in the family of mutators for the global symbol table,
`introduceTopLevel` is capable of creating synthetic top-level
classes and modules.
The addition of nme.EMPTY_PACKAGE_NAME is necessary to let
programmers insert definitions into the empty package. That's explicitly
discouraged in the docs, but at times might come in handy.
This patch introduce workarounds to avoid incompatibilities with SBT.
First of all SBT doesn't like VirtualFiles having JFile set to null.
Secondly SBT gets confused when someone depends on synthetic files
added by c.introduceTopLevel.
Strictly speaking these problems require changes to SBT, and that will be
done later. However the main target of the patch is paradise/macros,
which needs to be useful immediately, therefore we apply workarounds.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6916 makes FlatHashTable#remove a Boolean not Option[A]
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Makes FlatHashTable#remove return a boolean instead of Option[A].
Updates HashSet accordingly. Adds a test to make sure remove
works as advertised.
|
|/ / / / / |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
SI-6908 Makes FlatHashTable as well as derived classes support nulls
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | | |
This change adds a null sentinel object which is used to indicate that a null
value has been inserted in FlatHashTable. It also makes a strong distinction
between logical elements of the Set vs entries in the hash table. Changes
are made to mutable.HashSet and ParHashSet accordingly.
|
|\ \ \ \
| | | | |
| | | | | |
Fix Iterator#copyToArray (fixes SI-6827).
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As pointed out in #scala, when using a non-zero start it's possible
to get an ArrayIndexOutOfBoundsException due to an incorrect bounds
check. This patch fixes this, as well as another potential bounds
error, and adds test cases.
Incorporates some other suggestions by Som-Snytt to ensure that
callers will get useful error messages in cases where the start
parameter is wrong (negative or out-of-array-bounds).
Review by @som-snytt.
|
| |/ / /
|/| | | |
|
|\ \ \ \
| | | | |
| | | | | |
enclosures are now strongly typed and are no longer vals
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
the scanner is now less eager about deprecations
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Due to some reason, partest always enables -deprecation. Since Paul has
just submitted a pull request, which removes this behavior, I'm updating
the flags to make sure this test works even after Paul's change.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When healing braces it isn't very useful to report deprecation warnings,
especially since this process is just simple context-free skimming, which
can't know about what positions can accept what identifiers.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
fixes the typedIdent problem for good
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previous attachment retaining fix was only working for Idents which
get turned into Selects. Now it works for all transformations applied
to Idents (e.g. when an ident refers to something within a package obj).
|
|\ \ \ \ \
| | | | | |
| | | | | | |
macro expansions are now auto-duplicated
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The fix still requires macro developers to be careful about sharing trees
by references, because attributed DefTrees will still bring trouble.
However this is an improvement, because it doesn't make matters worse
and automatically fixes situations similar to one in the test.
A much more thorough discussion with a number of open questions left:
http://groups.google.com/group/scala-internals/browse_thread/thread/492560d941b315cc
|
|\ \ \ \ \
| | | | | |
| | | | | | |
adds extractors for TypeName, TermName and Modifiers
|
| | | | | | |
|
| | | | | | |
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This change allows to pattern match over type names, term names and
modifiers. Otherwise it can be quite painful to match over complex trees
as each name or modifiers requires a guard.
This pull request also changes the name of default constructor for term
and type names i.e. TypeName(s) instead of newTermName(s). This is
shorter to type, more consistent with the rest of reflection api and
consistent with the way it will be pattern matched later on.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In 658ba1b4e6 some inference was gained and some was lost.
In this commit we regain what was lost and gain even more.
Dealiasing and widening should be fully handled now, as
illustrated by the test case.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
I determined that many if not most of the calls to .normalize
have no intent beyond dealiasing the type. In light of this I
went call site to call site knocking on doors and asking why
exactly they were calling any of
.normalize
.widen.normalize
.normalize.widen
and if I didn't like their answers they found themselves
introduced to 'dropAliasesAndSingleTypes', the recursive widener
and dealiaser which I concluded is necessary after all.
Discovered that the object called 'deAlias' actually depends
upon calling 'normalize', not 'dealias'. Decided this was
sufficient cause to rename it to 'normalizeAliases'.
Created dealiasWiden and dealiasWidenChain.
Dropped dropAliasesAndSingleTypes in favor of methods
on Type alongside dealias and widen (Type#dealiasWiden).
These should reduce the number of "hey, the type alias doesn't work" bugs.
|