Commit Graph

13350 Commits

Author SHA1 Message Date
dragos 42ac0fce7b Changing the intersectionWitness map to use weak references for the value. A value may prevent parts of this map from collecting, since the value may hold a (strong) reference to one of the keys in the map. review by odersky.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23948 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 11:52:18 +00:00
prokopec 7fc1423e47 Fixes #4112. Closes #4112.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23947 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 10:47:30 +00:00
prokopec 3b2cd835d6 Added comments for #4008.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23946 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 10:47:26 +00:00
prokopec 6c2580dea7 Fixes #4054.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23945 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 10:47:23 +00:00
prokopec 3ddd7ad618 Enabled parallel group by.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23944 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 10:47:20 +00:00
extempore 5f4cced98e Unfinalized a couple unnecessarily final methods. Closes #4136, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23943 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 09:30:50 +00:00
extempore 89e7e2b755 Couldn't stop working on tailcalls. Cleaning and polishing, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23942 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 09:22:03 +00:00
extempore b76f663e12 A pretty severe bug in the recognition of tail call elimination.
It turns out that Tailcalls will perform "partial elimination" in
situations such as:

  @annotation.tailrec final def f(x: Int): Int = f(f(x))

The outer call to f1 becomes a jump, but the inner call remains
as it was.  I implemented @tailrec under the impression that if
the optimization had taken place, it had gone all the way.  So
this is now fixed with a direct examination of the rewritten tree.

While I was in there I threw in some improved error reporting:
the error positioning is now on the call which is not in tail
position rather than the method declaration.

Closes #4135, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23941 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 07:21:56 +00:00
extempore 14c1b41c43 Oops, the implicit not found message was wrong:
scala> implicitly[CanBuildFrom[String, Int, List[List[Int]]]]
<console>:10: error: Cannot construct a collection of type List[List[Int]]
with elements of type Int based on a collection of type List[List[Int]].
       implicitly[CanBuildFrom[String, Int, List[List[Int]]]]
                 ^

No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23940 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 07:21:41 +00:00
extempore e52ceda719 Fixed a mis-deprecation step where remove was replaced with filterNot
on a mutable collection.  Thanks to richard emberson for finding it.
I used what git fu I have searching for others, but no dice.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23939 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-10 05:38:50 +00:00
odersky 2f3bc01a1c Refactored browsing loaders so that they can be more easily reused from the builder. Review by plocinik.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23937 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-09 14:48:16 +00:00
odersky b6a85c6310 Implemented toplevel browsing in IDE, so that source files newer than their class files are scanned for contained classes and modules. That way, top-level symbols with names different than their enclosing class can still be identified. I believe the same strategy should be used by IDE/sbt builders. Reviw by plocinik
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23936 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-09 14:33:41 +00:00
odersky e68e56db3a Closes #4114. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23935 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-09 14:31:27 +00:00
extempore 00ad14c9b1 Closes #3984 by the most arduous and indirect route imaginable:
abstracts the common code out of the TrieIterators in HashMap
and HashSet.  When I raised this flag to find out if anyone would
open fire, all was quiet on the western front.  Although I wouldn't
want to write code like this as an everyday thing, I think it serves
as a nice showcase for some of the abstraction challenges we're up
against: performance looks the same and I will never again have to
fix the same bug in two places.  Review by rompf.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23934 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-09 06:30:35 +00:00
extempore acfe389f8c Brought back and deprecated onlyPresentation to unbreak sbt.
(Another fine reason for us to push all the way to using sbt
is that we wouldn't unwittingly break it, as that change and
my recent jline changes both did.) Maybe there is a better
way to do what's in this one: review by dragos.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23933 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-09 06:21:20 +00:00
extempore 4c3d4029dc Warded off an NPE (which only arose on erroneous code) in the
continuations plugin.  Closes #4132, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23932 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-09 04:11:43 +00:00
extempore 5ba210e531 The ensuring methods should be by-name on the message argument
like assert, assume, and require.  Closes #4129, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23931 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-09 04:00:00 +00:00
plocinic e765775a01 Reverting fix for #4047 until I figure out why it is failing on chara and not on my machine. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23929 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-08 20:57:45 +00:00
odersky e1c57b2512 Untangling parsers from compilation units so that we can browse toplevel symbols without full compilations.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23928 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-08 17:20:35 +00:00
extempore a3126f1431 Applying some short-term balm to scaladoc since it got all loopy
after that last patch.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23927 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-08 09:16:30 +00:00
extempore 46c89a7c78 Override checks and self-types still needed some work (ticket #2808.)
I believe this is the right change.  The modifications in parallel
and actors were a result of the files failing to compile after
the change to allOverriddenSymbols.  (I am taking the position
that that aspect is a feature.) Review by malayeri, odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23926 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-08 08:08:27 +00:00
extempore e01ab29c9c Great moments in code reuse:
def isRootOrEmptyPackageClass(s: Symbol) = s.isRoot || s.isEmptyPackageClass
  def isRootOrEmpty                        = (this == EmptyPackageClass) || (this == RootClass)
  def isEffectiveRoot                      = isRoot || isEmptyPackageClass
  // last one actually not quite identical
  def isUnqualified(n: Name)               = n match { case nme.ROOT | nme.EMPTY_PACKAGE_NAME => true ; case _ => false }

I was responsible for at least half of these.  Now it's only isEffectiveRoot.

Also, I have always found it warty that we have to specify Nothing and Any
as upper bounds.  I gave the TypeBounds companion object a few obvious methods:

  def empty: TypeBounds           = apply(NothingClass.tpe, AnyClass.tpe)
  def upper(hi: Type): TypeBounds = apply(NothingClass.tpe, hi)
  def lower(lo: Type): TypeBounds = apply(lo, AnyClass.tpe)

It's a lovable patch.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23924 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 19:07:01 +00:00
odersky ec61c46830 Made NamesDefault more robust to support idempotent compilation.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23923 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 14:44:18 +00:00
plocinic 5ff5d72a4f Added test for #4072. no review
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23922 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 14:42:58 +00:00
plocinic 9d39f363ed Deprecate Cell. Closes #4038, patch thanks to davetron5000. No review
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23921 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 14:42:54 +00:00
plocinic d32593371d Closes #4047. Review by odersky
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23920 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 14:42:49 +00:00
plocinic 23ac0f23ee Closes #4072. Fields in checkinit mode have their own bitmaps (one for public,private and protected and the other for transient fields). Those bitmaps are never inherited, this way you can freely mix code compiled with/without checkinit flag. Review by dragos
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23919 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 14:42:45 +00:00
rytz 6fae707dfc re-added @SerialVersionUID(0) to anonymous function classes.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23918 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 14:33:04 +00:00
odersky ace108ac32 moved debug println under if(settings.debug.value) condition.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23917 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 14:08:40 +00:00
odersky b8f004469b Missing file from last commit.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23916 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 13:29:25 +00:00
odersky 7173e20f47 Documented Picklers. Added pickler for EmptyAction that's executed upon shutdown.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23915 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 13:29:04 +00:00
prokopec 5e3e77bb26 Test case change.
No review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23914 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 12:05:37 +00:00
prokopec b2fc443915 Implemented a (slower) workaround for parallel vectors.
Implemented group by.

No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23913 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 12:05:31 +00:00
prokopec 618e00acc6 Changed foreach to pforeach.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23912 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 12:05:21 +00:00
extempore a8c997c883 Apparently my flailing attempts to make things faster earned
me the pity of Tiark, who sent this monster patch which he probably
dashed off before the appetizers had been cleared away.  All the steak
is his but I threw in a little sizzle so I could feel like a part
of things.  It knocks about a bazillion miniseconds off the time
spent in implicit search.

This is the same patch martin already endorsed, give or take several
hundred lines of diff, so I will say no review, even though I know it
will be hard to look away.  I trimmed most of the "speculative code" (that
is, the commented out bits) because it's getting awfully busy along those
sidelines.  I will preserve the ideas in some more structured form.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23911 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-07 06:18:26 +00:00
extempore dcd8271c2f The shutdown hook installed by jline has made life difficult for
sbt for a while.  This changes jline not to install it, and alters
the scala startup script to trap exit and re-enable echo on
recognizably unix platforms.  In addition it no longer installs
a shutdown hook to flush the repl history to disk, instead flushing
after every line.

Any bash reviewers out there? Unless someone raises a hand, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23909 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-06 19:47:38 +00:00
odersky 6cad95d391 One reversal wrt Pauls TypeRef -> typeRef changes. (rest looks fine to me)
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23908 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-06 17:28:26 +00:00
odersky ba34870a9e Replay now enabled for presentation compiler.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23907 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-06 16:20:51 +00:00
extempore 489b3234d2 I took the following comments at their word:
// Cannot be created directly; one should always use `singleType' for creation.
// Cannot be created directly; one should always use `refinedType' for creation.
// Cannot be created directly; one should always use `typeRef' for creation. (@M: Otherwise hashing breaks)

This involved altering about 15 locations.  If there was a
rhyme or a reason as to why those particular places were entitled
to ignore the "always" dictate, I trust it will emerge from some
corner now.  Until then, it's nice to see some code following its
official marching orders.  Review by odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23906 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-06 08:44:28 +00:00
extempore 5850809376 Renamed the files whose names have fallen out of sync with their contents
thereby consigning us to ant's version of groundhog day.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23905 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-06 02:09:57 +00:00
extempore 469038ba2d Avoids the creation of an amazing 106,700,793 empty arrays
(I counted on my fingers) during the compilation of quick.lib and
quick.comp by reusing an empty Array[Object].  (And another ten
million or so after quick.comp, but who is counting.) It sounds
like it would make a bigger difference than it does.  Also
eliminated some strange indirection from WrappedArray to
LowPriorityImplicits back to WrappedArray on each creation.

Review by dragos.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23903 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-05 23:39:35 +00:00
extempore f6d7694f61 De-finalized equals/hashCode on Trees so people ill-advisedly
creating custom Trees with non-reference equality can continue
doing their ill-advised thing.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23902 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-05 22:37:19 +00:00
dragos 02a7f99847 Fixed a bad interaction between overloading, default parameters and specialization.
Closes #3896, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23901 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-05 17:37:24 +00:00
moors 37276f74b7 closes #4044. kind checking ignored trailing higher-order arguments. no review
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23900 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-05 09:35:16 +00:00
extempore fb5299a2b6 Eliminated 16 avoidable closure objects in Stream. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23898 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-04 23:40:28 +00:00
dragos 64ff0d74c0 Disentangled scaladoc and the presentation compiler. Now there are different flags, forInteractive and forScaladoc, instead of the overloaded onlyPresentation. While it is unfortunate to have these flags, I know of no easy way to customize the typer (the behavior they control is pretty deep into the analyzer). This shaves off around 100MB of unnecessary docComments from the presentation compiler. review by odersky, dubochet.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23897 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-04 17:06:20 +00:00
odersky 8f86be4d41 Towards a replay framework for the presentation compiler
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23896 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-04 17:05:37 +00:00
dragos 9be9ac7890 Closes #3869. no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23895 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-04 14:52:45 +00:00
eugenevigdorchik d06e40044d One more try with the lazy clearing. Locally lisp test compiles no problem. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23894 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-04 14:47:14 +00:00
plocinic c639b72bd5 Closes #3687, #3719, #3950, #3616. Plus removed some deprecated stuff for 2.9. Review by extempore
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23893 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-04 10:38:41 +00:00