| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
| |
Restored test case for SI-2873 which hubert had callously deleted back
when it was briefly irrelevant. It would have been failing were it
around, but now it passes. Closes SI-2873, no review.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modified erasure so we have enough information to determine whether we
need to use scala or java erasure semantics. This fixes the runtime
failure illustrated here:
% scala29 -e 'java.util.Collections.max(null)'
java.lang.NoSuchMethodError: java.util.Collections.max(Ljava/util/Collection;)Ljava/lang/Comparable;
Review by odersky.
|
|
|
|
|
| |
Contributed by Daniel C. Sobral.
|
| |
|
|
|
|
|
|
| |
Bounded wildcard types arising during pattern type inference can cause
unnecessary crashes. Closes #1048, review by odersky.
|
|
|
|
|
| |
Making power mode startup a little less glacial, no review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type mismatches, for real this time. :power mode goes to phase typer
automatically.
You can get the symbols for repl-defined names more directly:
scala> case class Bippy(x: Int)
defined class Bippy
scala> intp.terms("Bippy")
res1: intp.global.Symbol = object Bippy
scala> intp.types("Bippy")
res2: intp.global.Symbol = class Bippy
scala> intp("Bippy") // tries type first
res3: intp.global.Symbol = class Bippy
scala> intp("scala.collection.Map") // falls back to fully qualified
res4: intp.global.Symbol = trait Map
I changed the implicit which used to install "tpe" and "symbol" to
install "tpe_" and "symbol_" because it was too easy to do something you
didn't mean to, like calling x.tpe where x is a Manifest.
Said implicit now handles manifest type arguments, so you can get the
full translation from a manifest representation to a compiler type, at
least for simple types and only as much as manifests work, which is not
that much. Fortunately that situation is all changing soon.
scala> List(List(1, 2, 3)).tpe_
res5: power.Type = List[List[Int]]
scala> res5.typeArgs
res6: List[power.global.Type] = List(List[Int])
Review by moors.
|
|
|
|
|
| |
Review by extempore.
|
|
|
|
|
| |
Review by extempore.
|
|
|
|
|
| |
Review by extempore.
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
| |
This changes the signature of flatten - I do not see how to use a @bridge annotation here, since after erasure both the bridge and the original method have the same signature.
Review by extempore.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed a bug in the optimizer which was preventing private methods from
being inlined. Also relaxes a condition related to the "liftedTry"
problem: the inliner has to exclude certain methods from consideration
if there is a value on the stack and the method being inlined has
exception handlers. The new condition is as before, except that it does
not exclude methods of the "try/finally" variety (i.e. finalizers, but
no other exception handlers.) This is necessary to optimize this common
pattern:
@inline private def foo(body: => Unit) {
val saved = something
try body
finally something = saved
}
The closure for "body" can be fully eliminated, but only if the contents
of foo can be inlined into the caller.
Closes #4764, review by rompf.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Fixed a bug involving classOf[Foo] having the wrong erasure. Luckily I
had only days ago deciphered the unique handling of classOf, so I knew
what was up. Closes #4753, review by odersky.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Somehow case objects fell through the cracks and have had default
hashCode implementations, leading to new hashCodes on each jvm run. Now
we use the productPrefix, and inline it right into the bytecode.
scala> None.## == "None".##
res0: Boolean = true
Closes #4752, no review.
|
|
|
|
|
|
| |
Keep BufferedSource from losing buffered data when a derivative iterator
is created via getLines. Closes #4671, #4662, no review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
possible, just far enough to avoid all kinds of undesirable consequences
which accompany the preservation of too much type information. (The
problems are akin to inferring the singleton type too freely.)
// Example of code which did not compile, but now does class A class
B[T <: A](cons: T)
object C extends B(new A {})
Closes #4110, #3048. I already ran this by moors, so review by odersky.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hunch by adriaan (needed to change Object to Any in strategic location),
location + fix determined by paul,
menial work (reverts of obsolete spears and introduction of fix) by
adriaan
review by extempore
Revert "A line missed from spear thrust, no review. Revert "
"Thrusting spear into darkened alcove attempting to slay java5 "
Revert "New theory: fails running on java 1.5. Put in hack to "
discover Revert "Everything builds for me, but apparently not for "
jenkins. First "
|
|
|
|
|
| |
truth of theory. No review.
|
|
|
|
|
| |
Moved test for #4727 to where it was supposed to go, no review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A total rewrite of "runtimeClass", discarding the user-space approach in
favor of simply fixing getClass.
def f1 = 5.getClass // Class[Int]
def f2 = (5: AnyVal).getClass // Class[_ <: AnyVal]
def f3 = (5: java.lang.Integer).getClass // Class[_ <: java.lang.Integer]
class A
class B extends A
def f1 = (new B: Any).getClass().newInstance() // Any
def f2 = (new B: AnyRef).getClass().newInstance() // AnyRef
def f3 = (new B: A).getClass().newInstance() // A
def f4 = (new B: B).getClass().newInstance() // B
But that's not all!
def f0[T >: B] = (new B: T).getClass().newInstance()
def f5 = f0[Any] // Any
def f6 = f0[AnyRef] // AnyRef
def f7 = f0[A] // A
def f8 = f0[B] // B
Closes #490, #896, #4696. Review by moors. (Note: I think this is pretty
good, but picky review requested.)
|
| |
|
|
|
|
|
|
|
|
| |
Removed "isInterpreterWrapper" from the conditions which imply an
effective root. This was an old hack from before my time which is no
longer necessary and then recently became actively hostile. Closes
#4710, no review.
|
|
|
|
|
|
| |
Routed Stream.+: through cons to avoid some truly pathological
performance. Closes #4697, no review.
|
| |
|
|
|
|
|
| |
No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
| |
When TypeVars were given higher-order abilities, so too should have been
WildcardType, which acts as a plceholder for typevars. Always inflicting
arguments upon it was the cause of #2308. Closes #2308, review by moors.
|
|
|
|
|
|
|
|
| |
Fixed an overflow which occurs in hashtable size computations. Fixes
#4678.
No review.
|
|
|
|
|
|
| |
Go back to printing the message that transcript pastes can be finished
with ctrl-D. No review.
|
|
|
|
|
|
|
| |
Test case for implicits which unwrap typeclasses, something which must
really live on the edge given the multiple ways we've busted it lately.
Also some Array/signature and repl tests. No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Views using methods implemented in terms of isEmpty (in particular,
headOption and lastOption) were traversing the collection twice up
to the nonEmpty element, because "if (isEmpty) None else Some(head)"
means calling isEmpty separately from head. I overrode those methods in
TraversableViewLike to avoid the second traversal.
This leaves at least init and tail still in that boat, but they were
getting too involved.
How do I say "review by pool of reviewers", who can help set that up? In
the meantime no review.
|
| |
|
|
|
|
|
|
| |
A test case demonstrating some of the issues with DelayedInit.
References #4680. Review by odersky.
|
|
|
|
|
|
|
|
|
| |
Tweaks repl tests to enforce -Yrepl-sync and other setup on all clients.
Also includes some more why-do-tests-hang bosons for the particle
accelerator in case that doesn't wrap it up. I think it will though,
because now constrained-types is the only one which failed and it's also
the only one which overrides Settings. No review.
|
|
|
|
|
|
|
|
|
|
|
| |
Modified erasure not to generate instance tests for statically known
types. It appears the production of types like "Foo with Bar" in the
pattern matcher (where the scrutinee is known to be Foo) has been a
major contributor of suboptimal pattern matches. I will also fix it in
the matcher, but it makes sense to catch it in erasure as both a check
on the matcher and because they may come from elsewhere too. Review by
odersky.
|
| |
|
| |
|
|
|
|
|
|
| |
More adjustments to repl parsing to accomodate inaccurately positioned
parse trees. No review.
|
|
|
|
|
|
|
|
| |
Fixed a repl regression with parentheses handling, reminding me we
really need that honest parser phase which doesn't betray us with
parentheses abandonment and dramatic desugarings. I'll promote it from
page 14 to page 11. Closes #4661, no review.
|
|
|
|
|
| |
test in r25038, so closes #4512, no review.
|
|
|
|
|
|
| |
Cleaning up power mode import issues (and the amazing first power mode
test) no review.
|
|
|
|
|
|
|
| |
Now :t types declarations as well as expressions, and cleans up the
output the same way the repl does so stray unsolved type constraints
don't befuddle anyone. Closes #4391, no review.
|
| |
|
|
|
|
|
|
| |
Yikes, prependToList was violating List immutability. Closes #4656, no
review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Overcoming limitations of the repl, multiple-tree lines and assignments.
The best part of nicely documented limitations is that you can stare at
the same comment for years and then the day comes when you give it the
heave-ho.
Exhibit A (regarding a single bare expression): "This is necessary due
to it being hard to modify code at a textual level, and it being hard
to submit an AST to the compiler." Yes, it IS hard to modify code at
a textual level (see enclosed patch) but we won't let that stop us
anymore. Closes #4578.
Exhibit B (regarding the left hand side of assignments having to be
Ident): "An unfortunate limitation." Unfortunate no longer! No review.
|