Commit Graph

14295 Commits

Author SHA1 Message Date
extempore 3da81185ba Defined tpeHK in a manner consistent with tpe so it has a better
chance of being found/understood, and tried to clean up its documentation
a little bit.  Review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25153 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-24 13:16:45 +00:00
extempore 590fcf5179 Integrating feedback from adriaan, changed another call to tpe
to tpeHK and simplified the surrounding method.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25152 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-24 13:16:30 +00:00
extempore 3d1e14d51f Another one brought to compilation by r25149. Test case closes #1318, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25151 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-24 13:16:17 +00:00
extempore 5abc44a1d8 A test case from recently closed #490, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25150 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-24 13:16:03 +00:00
extempore c1698844e8 Added sanity check to lub calculation to prevent invalid lubs from
emerging. The underlying cause of said lubs is that higher-order
type parameters are not handled correctly: this is why the issue
is seen so frequently in the collections. See pending test
pending/pos/those-kinds-are-high.scala for a demonstration. Until that's
fixed, we can at least raise the bar a bit.

Closes #2094, #2322, #4501. Also, some test cases in neg have been
promoted into working programs: #2179, #3774. (They're not in neg for
the "shouldn't work" reason, but out of despair.)

In some cases, such as the original reported ticket in #3528, this
only pushes the problem downfield: it still fails due to inferred type
parameters not conforming to bounds. I believe a similar issue with
higher-order type parameters underlies that.

Look at how far this takes us though.  All kinds of stuff which
did not work, now works.  None of these even compiled until now:

  scala> :type List(mutable.Map(1 -> 1), immutable.Map(1 -> 1))
  List[scala.collection.Map[Int,Int]]

  scala> :type Set(List(1), mutable.Map(1 -> 1))
  scala.collection.Set[Iterable[Any] with PartialFunction[Int,Int]]

  scala> :type Stream(List(1), Set(1), 1 to 5)
  Stream[Iterable[Int] with Int => AnyVal{def getClass(): Class[_ >: Int with Boolean <: AnyVal]}]

  scala> :type Map(1 -> (1 to 10), 2 -> (1 to 10).toList)
  scala.collection.immutable.Map[Int,scala.collection.immutable.Seq[Int]]

PERFORMANCE: compiling quick.lib and quick.comp, this patch results in
an extra 27 subtype tests. Total. Time difference too small to measure.
However to be on the safe side I made it really easy to disable.

  private final val verifyLubs = true // set to false

Review by moors, odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25149 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-24 05:42:08 +00:00
moors 5701bdac97 getting the revamped getClass to work on Java 5
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"

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25148 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-23 10:26:42 +00:00
extempore 40ee8e71a6 Overrode contains and apply in mutable.HashMap to avoid allocating
an unnecessary Some on every call to either of them. Fruit looks a
little better defended in immutable.HashMap, so I deleted a bunch of old
debugging code instead. Closes #4469, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25147 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-23 06:13:55 +00:00
extempore 9274b3f037 Notice when erasure is trying to cast something to Unit, and don't
do it.  I'm not sure at what prior point such things should have been
caught, but for now we can have a sanity check.  Closes #4731,
review by odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25146 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-23 06:13:31 +00:00
extempore da811372d2 Added a -Y option to resolve namespace collisions between package and
object. It's a blunt instrument: if people have lots of these conflicts
they need to resolve in individually nuanced fashion, they'll probably
remain out of luck. But now people can use YourKit probes without a
custom hacked compiler. Let's say this closes #2089. Review by odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25145 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-23 06:13:11 +00:00
extempore 600f2fb642 Playing defense against NoSymbol in scaladoc, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25144 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-23 02:42:22 +00:00
extempore b59bc011e9 Noticed while working on getClass that most of the
implementations for $hash$hash can be inlined directly,
with this kind of beautiful change:

  // source
  def hash(x1: Int, x2: Int) = x1.## + x2.##

  // before
  0:	getstatic	#11; //Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
  3:	iload_1
  4:	invokevirtual	#27; //Method scala/runtime/ScalaRunTime$.hash:(I)I
  7:	getstatic	#11; //Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
  10:	iload_2
  11:	invokevirtual	#27; //Method scala/runtime/ScalaRunTime$.hash:(I)I
  14:	iadd
  15:	ireturn

  // after
  0:	iload_1
  1:	iload_2
  2:	iadd
  3:	ireturn

No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25143 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-23 00:08:33 +00:00
extempore e45007f520 A line missed from spear thrust, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25142 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 23:35:48 +00:00
extempore 67db9f7f1b Thrusting spear into darkened alcove attempting to slay java5
build failure.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25141 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 23:32:57 +00:00
extempore a052f0999c New theory: fails running on java 1.5. Put in hack to discover
truth of theory.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25140 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 22:46:37 +00:00
extempore 32aa8a8578 Moved test for #4727 to where it was supposed to go, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25139 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 22:12:26 +00:00
extempore cb7fe71fdf Everything builds for me, but apparently not for jenkins. First
attempt to solve mystery: explicitly set return type of Any#getClass()
to Class[_ <: Any] rather than allowing java's to be used.  I'm
guessing that somehow it materializes as Class[_ <: Any] sometimes
and Class[_ <: AnyRef] other times.  Review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25138 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 22:00:53 +00:00
extempore 341f3059b7 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.)

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25137 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 21:10:33 +00:00
extempore 2ff04e7289 Test case closes #4727, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25136 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 21:09:57 +00:00
prokopec e71e312600 Updated a test with GenSetLike.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25135 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 10:57:01 +00:00
prokopec d368b01693 Removing the package-private modifiers on Gen*Like traits.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25134 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-22 10:56:58 +00:00
extempore df35812400 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.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25133 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 21:54:03 +00:00
extempore 2dcc03582c Relaxes a typer check which fails valid code with NoCommonType. If the
instantiated types or type bounds do not conform, it tries normalizing
the type before throwing the exception. Closes #4553. I wrote this patch
with adriaan already, but bonus review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25132 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 17:21:07 +00:00
extempore 3993bc7902 Documented what happened with the implementation of narrow for
future performance detectives.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25131 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 17:20:51 +00:00
extempore 366474e8ab Routed Stream.+: through cons to avoid some truly pathological
performance.  Closes #4697, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25130 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 17:20:39 +00:00
odersky 53b218e8cd Added test case.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25129 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 11:46:17 +00:00
odersky b6ff50b135 Putting in a fix for #4713. Not sure this goes deep enough, though. Review and maybe deeper changes by plocinic.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25128 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 11:43:25 +00:00
odersky d5cf962462 Fixes Zendesk ticket #1528. Review by prokopec.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25127 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 10:27:19 +00:00
odersky c6a46268a4 Fixes #4712. Review by moors.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25126 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 10:09:50 +00:00
extempore feddca5f5c Performance-motivated work: going through SpecializeTypes and eliminating
unnecessary intermediate data structures and multiple traversals of
lists.  Also trying to get that code under control: it dwarfs all
other phases in terms of debugging output, and a too-large percentage of
the source is commented out debugging code which looks past its sell-by
date.  I realize the patch is a little big for a very thorough review,
but review by dragos, prokopec.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25125 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 04:29:22 +00:00
extempore b2cd9a5c64 Quoted the windows runner path so "c:\program files (x86)" has some
chance of working.  Closes #4636, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25124 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 04:29:03 +00:00
extempore 7de44fab17 Removed an unused method. Closes #4708, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25123 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 04:28:48 +00:00
extempore a5c79ca226 Deprecated BigInt#~ in favor of unary_~. Closes #4659, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25122 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 04:28:33 +00:00
extempore 33db9ea391 Some tests for pending, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25121 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 04:28:20 +00:00
extempore faca2e4cb2 Test case closes #4601, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25120 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-21 04:28:05 +00:00
extempore 88c0f3c32f Fix broken tool-windows.tmpl. Closes #4614, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25119 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 19:21:10 +00:00
odersky 9ac29a997a Small changes to docs only. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25118 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 17:22:12 +00:00
extempore 139ff44a69 Reverts r25085 ("Performance tweaks for AbstractFile, no review.")
which apparently is making the IDE refuse to overwrite classfiles.
For the life of me I can't find why there should be any difference.
Bowing to expedience, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25117 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 16:08:45 +00:00
prokopec b7d62b189f Moved a test to pending.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25116 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 15:57:07 +00:00
prokopec e10145aafa Disabled failing test.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25115 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 15:38:39 +00:00
extempore 179908e59e 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.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25114 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 15:28:15 +00:00
kzys 257acd4e86 Separete index.js to parallelize downloads. Review by dubochet.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25113 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 14:20:45 +00:00
prokopec 295d07a78f Fixed an overflow which occurs in hashtable size computations. Fixes #4678.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25112 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 13:36:24 +00:00
prokopec d3972c254c Fixing a parallel sets issue with flatmap.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25111 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-20 13:36:22 +00:00
extempore f74603f0eb Fixed an issue with higher kinded type inference on constructors
without any help from adriaan.  Provisionally notched belt.
Wrapped up as many tickets as I added characters of code.
Closes SI-3343, SI-4018.  Review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25110 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-19 21:43:53 +00:00
extempore 42be942393 Upgraded jline to use jansi 1.6 in the belief it will cure SI-4703.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25109 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-19 17:56:58 +00:00
kzys d23b539163 Formatting fixes for scala.collection.JavaConverters. Contributed by Daniel Capo Sobral. Review by dubochet.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25108 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-18 23:03:57 +00:00
kzys e7df6eb482 Further ScalaDoc fixes. Contributed by Simon Ochsenreither. Review by dubochet.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25107 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-18 22:42:00 +00:00
extempore e2ea433361 The usual unbreaking of broken builds, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25106 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-18 18:37:55 +00:00
kzys f4b1b6382d Formatting fixes for scala.util. Contributed by Simon Ochsenreither. Review by dubochet.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25105 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-18 14:32:44 +00:00
kzys 078f0fa12e Formatting fixes for Parsers. Contributed by Simon Ochsenreither. Review by dubochet.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25104 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-06-18 14:26:35 +00:00