Commit Graph

14910 Commits

Author SHA1 Message Date
moors 7ee69b0710 misc fixes while working on virtualizing pattern matching not directly related to pattern matching, though
review by extempore

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25863 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:29:04 +00:00
moors 9356998149 infer singleton when asking for it
a type var's constraint now also tracks whether the type var was compared to a stable type

if it was, we probably shouldn't widen the type argument that's inferred for this var,
as the result will surely fail to type check

NOTE: must be enabled using -Xexperimental

review by extempore

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25862 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:28:58 +00:00
moors bbcfe17ec5 more flexible inference wrt type skolems
instead of barring types that have been skolemized after the TypeVar they're being compared against, (isRelatable)
simply remember when a type var is compared to a type skolem from a later skolemization level
finally, repack the solution for the type var into a fresh existential if the compared level exceeded ours

NOTE: must be enabled using -Xexperimental

review by extempore

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25861 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:28:53 +00:00
moors 5a04563e89 5033: align bound syms when comparing method types
can't believe I missed that one...

closes SI-5033

more complete test case to make sure the multi-arglist case works as well

no review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25860 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:28:50 +00:00
moors 10058c5b6b dependent methods types are now always enabled
for now, left the old if(settings.YdepMethTpes.value) guards in comments

removed *.flags containing -Ydependent-method-types
also updated one check file with one fewer error

no review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25859 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:28:44 +00:00
moors 59d43d74ca no need to add an x field to everything
however, it must be possible to inline Ensuring, ArrowAssoc methods

renamed the public val x to something a little less intrusive

fixed check file to reflect better error message (see! it wasn't that uncommon for people to write `foo.x` -- NEWS AT ELEVEN)

no review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25858 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:28:39 +00:00
moors 972f8d438c eternalized Paul's findings wrt thisSym
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25857 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:28:35 +00:00
moors 2fd7ea1af2 cleaned up addEvidenceParams a bit
implemented my own feedback from https://codereview.scala-lang.org/fisheye/cru/SR-1022#CFR-23393

no review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25856 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:28:31 +00:00
extempore 3cccc5c126 More decomposition of Namers.
Having I think established this isn't merely a dance around the
maypole, I'm going to continue breaking down Namers because it's
hard to figure out where my stubbing mechanism is colliding with
the existing logic.  Getting there, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25855 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 19:50:45 +00:00
extempore 9631f75f45 AbstractPartialFunction.
Contributed by Todd Vierling with minor mods by extempore. This is an
obvious extension of AbstractFunctionN which I had some issue making
work at the time. Sounds kind of pitiful given that the compiler patch
is about two lines, but let's all agree to believe it was a different
world then.

This example program is impacted as follows:

    class A {
      def f: PartialFunction[Any, Int] = { case x: String => 1 }
      def g: PartialFunction[Any, Int] = f orElse { case x: List[_] => 2 }
      def h: PartialFunction[Any, Int] = g orElse { case x: Set[_] => 3 }
    }

Before: 34943 bytes of bytecode
 After:  4217 bytes of bytecode

A mere 88% reduction in size. "'Tis but a trifle!" Closes SI-5096, SI-5097.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25854 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-19 21:31:55 +00:00
extempore 1ae87317ab Overhaul of mixin.
If extempore is going to fix the hard bugs then first he is going to
make them less hard to fix. The major work of interest in here is the
decomplification of the bitmap logic. Hopefully this will come in handy
for anyone wishing to try out other encodings.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25853 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-19 20:23:13 +00:00
extempore 7278b610e4 Cycle defense.
Notice when a typeref's info creates an obvious cycle, so we can see an
error instead of a stack overflow.  Closes SI-5093, review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25852 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-19 17:19:08 +00:00
heathermiller 4815c52f1d Tweaks to Any and AnyRef documentation, courtesy of Seth Tisue. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25850 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-18 18:54:41 +00:00
extempore 16cd1b6dde Documentation to Namers.
Added some reverse engineered documentation to Namers, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25849 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-18 17:58:16 +00:00
extempore 70b4d69846 Fixing valueOfTerm in the repl.
Impressed at the amount of ticket traffic for an unadvertised internal
method.  All the more reason to work toward that support repl API.
Don't worry, it'll come.  Closes SI-4899, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25848 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-18 17:58:04 +00:00
extempore 71e733b887 Shutdown hook modification.
Don't mark shutdown hooks as daemon threads, although it does
not seem to make any difference.  Instead have the code which
waits for all threads to be complete be smarted about which
codes to monitor.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25847 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-18 17:57:48 +00:00
extempore ace0048f41 Fix for comparison warnings.
true == new java.lang.Boolean(true) will in fact sometimes be true.
Also fixes a bug caused by this change in r23627.

  -    lazy val SerializableClass    = getClass(sn.Serializable)
  +    lazy val SerializableClass    = getClass("scala.Serializable")

It used to be java.io.Serializable.  Hey, let's not change the meaning
of existing symbols which are in active use.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25846 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-18 17:57:29 +00:00
extempore 05d7d8ac28 Overhaul of Namers.
I can't go bear hunting without a clean gun. Basically I iterated over
Namers until I could understand it. I added a variety of documentation
there and elsewhere. There shouldn't be anything particularly behavioral
changing in this commit, but I did delete some years-old code (having
huge commented out blocks of way-out-of-date code is not a boon to
understanding) and the debugging output will look different.  Better,
one can hope.

How about, review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25845 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-17 22:00:57 +00:00
cunei 10cbfc9142 Reverting r25787 (caused test.scaladoc failures on certain systems)
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25844 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-17 21:42:43 +00:00
extempore 5ed2be0132 Cleaning up debug logging.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25843 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-17 20:59:28 +00:00
grek 5fa6b4d0c2 Do not depend on java.rmi.* when not necessary.
This is small correction of fix committed in r25814.
We need to swap terms in logical conjuction so
java.rmi.* stuff is accessed only if triggered by
@remote annotation.

No review.


git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25841 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-17 11:41:57 +00:00
heathermiller f9412098f3 Big improvements to scala.Either. Contributed as part of the October doc spree, by David Winslow and Heather Miller.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25840 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-16 23:13:00 +00:00
extempore f58ca4f213 Addendum to previous patch.
In one of those unlikely accidents, I managed to lose the call
to evalOnce while still fixing the reported bug in a different
way (function composition led to the target only being called
once anyway.) No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25839 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-16 17:06:47 +00:00
extempore 975b768dde Fix for multiple evaluation in structural calls.
An interesting bug during cleanup: runtime checks on the target of a
structural invocation duplicated the selection without regard for the
fact that it might be an expression. So if the name of the method being
invoked allowed the possibility that the target was a primitive type
(such as "toInt") the expression would be evaluated three times.

Closes SI-5080, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25838 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-16 16:57:20 +00:00
extempore f6f68b170c revise and expand root-level Scaladoc
added section headers, tightened the wording, shortened the list of
selected important packages, and explained automatic imports more

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25837 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-15 23:17:45 +00:00
extempore 099b5ea5a1 Donated some parens to Any.
And a touch of documentation correctness.  Closes SI-5077, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25836 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-15 22:00:39 +00:00
extempore bff8d0b664 Test case closes SI-3898, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25835 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-15 22:00:08 +00:00
extempore 8318236705 Harden the typer against surprise unapply types.
Closes SI-5078, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25834 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-15 21:59:37 +00:00
extempore 36a211ee81 Changed a power mode import.
Applying a bandaid since I'll never get the globals lined up.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25833 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-15 12:40:59 +00:00
michelou 23cdcc4274 removed quotes in partest.bat, added svn props
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25832 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-15 09:31:50 +00:00
extempore 72fbc84e54 Fix regression in companion check.
Pulling back from expensive path normalization caused a regression
where companions were no longer recognized as such after specialization.
(Specifically, the paths turned up as "test.scala" and "./test.scala".)
I made it a two-level check, doing the expensive one before failing.
Closes SI-5023, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25831 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-15 00:14:04 +00:00
extempore 9887c140f3 Another swing at r25823.
I verified this creates identical library bytecode so I anticipate
no regressions.  Review by prokopec anyway.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25830 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-14 04:27:35 +00:00
extempore d12cff42a6 Better error when abstract methods are missing.
When many methods are missing, print a list of signatures the way they
need to be implemented, and throw in ??? stub implementations so it
should be compilable code.  If anyone would like this logic exposed
more generally (for the IDE or whatever) just let me know.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25829 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-14 02:16:17 +00:00
grek 2a6f29fc46 Reverted r25823 as it breaks specialization of traits.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25828 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-13 23:00:38 +00:00
extempore 086e4f6ea3 Renamed isPureExpr to isExprSafeToInline.
Taking adriaan's advice for what name would better describe
this method.  Yours in reduction of ambiguous terminology, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25827 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-13 21:07:11 +00:00
extempore 14f4ffd3a0 Adjustment to @switch.
Don't require a tableswitch if the matcher elected not to emit
one because there were so few cases.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25826 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-13 20:50:58 +00:00
dragos 94299fceba Added back reporting of comment tokens from the Scanner. This allows the IDE to show 'TODO' tasks in the Tasks view.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25824 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-12 10:53:23 +00:00
extempore d4a2e5ba3c Propagate self-type to specialized subclasses.
Closes SI-5071, review by prokopec.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25823 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-11 22:17:32 +00:00
extempore 37301bc1ff Throw different exception.
Booleans aren't numbers.  Closes SI-5032, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25822 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-11 22:17:17 +00:00
odersky 14048c62b2 Added check file for test. Moved method in TreeBuilder around so that their position is more logical.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25821 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-11 15:57:13 +00:00
odersky a7cd66d002 Simple test case for string interpolation.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25820 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-11 14:53:21 +00:00
dragos 9ab5f67183 Presentation compiler: let ShutdownReq propagate from the background compiler, and don't mark a unit as crashed in that case.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25817 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-11 09:58:13 +00:00
extempore bf8355121b Batting back a java.rmi.* dependency.
The scala gwt project does not like have a sudden dependency
on java.rmi.Remote show up in the mail.  Review by grek.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25814 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-10 15:08:54 +00:00
extempore 211204d0f7 Avoiding String.isEmpty.
It has a full quiver of ways to break us, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25813 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-10 15:08:38 +00:00
odersky 6975fc7fe1 String interpolation added as experimental feature. Review by extempore.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25812 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-10 13:53:09 +00:00
extempore f0d0f787f5 Moved meta annotations to annotation.meta, plus.
It took me a long time to find a trivial error while adjusting the
annotation packages, so I spent even longer trying to make sure next
time it would take me less time. It's the usual business of eliminating
duplication and unnecessary indirection.

Behavioral note: there was no consistency or deducible reasoning
regarding when annotation checks would be performed against the
typeSymbol directly (thus excluding annotation subclasses) or when they
would do a subclass check. I saw no reason it shouldn't always be a
subclass check; if the annotation isn't supposed to be subclassed it
should be final, and if it is, then the subclasses had probably better
not stop exhibiting the behavior of the base class.

Example: this now draws deprecated warnings, but did not before.

  class bippy extends deprecated("hi mom", "burma shave")
  @bippy def f = 5

(The deprecation message isn't printed so we're not there yet,
but closer.)

There is some new internal documentation on annotations, sadly lacking
in my famous ascii diagrams, and some new conveniences. Review by rytz.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25811 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-10 06:24:46 +00:00
Mirco 4f98dc4b6b Minor update of the PC's testing framework. Specifically, loosed access modifiers of a few methods so that they can be accessed by the test runner definition. no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25810 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-09 20:55:55 +00:00
extempore 0a2098a2ad Flipped varargs eta-expansion behavior.
(T*)U now eta-expands to Seq[T] => U, not T* => U.  There is a
transition command line switch to get the old behavior for any who
may have relied upon it:

  -Yeta-expand-keeps-star

Closes SI-4176, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25809 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-09 19:24:48 +00:00
extempore 15564b2b69 Fix for error printing regression.
One's devotion to aesthetics must not be allowed to trump one's
commitment to clearly delineated tuplehood.  Closes SI-5067, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25808 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-09 19:24:26 +00:00
heathermiller ca66023961 Big improvements to the documentation of collection.Iterator, courtesy of Daniel Sobral. Also includes a small correction to the documentation of sys.process.Process. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25807 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-09 16:48:27 +00:00