Commit Graph

14910 Commits

Author SHA1 Message Date
plocinic fdd3c8d454 Fixed paths for 'neg' tests. One unicode test had to be adapted as well. review by extempore (should we enable this for pos and friends as well?)
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25922 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-11-01 00:58:36 +00:00
plocinic 041f4bdeaa Fixed failing pc tests. no review
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25921 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-31 23:41:32 +00:00
plocinic 9e7149ef60 Revert r25648 by michelou, it brakes partest
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25920 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-31 23:41:27 +00:00
plocinic 38655403d0 Fix doc comment. no review
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25919 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-31 23:41:21 +00:00
extempore 562f8c1c13 Fix for NumericRange boundary condition.
Contributed by Thomas Switzer.  Closes SI-4985, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25918 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-31 18:26:57 +00:00
extempore 3b4de38e62 Fixes NPE using iterator with an XML attribute being null or None (SI-5052)
Also fixes incorrect size method (SI-5115)

Contributed by Jordi Salvat i Alabart.  Closes SI-5052, SI-5115, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25917 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-31 18:26:41 +00:00
extempore 87dc3ab288 Clean result of function type.
NullaryMethodType was escaping.  Closes SI-5099, review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25916 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-31 16:37:59 +00:00
odersky b4f718a459 Code to locate currently transformed unit in case of crashes. Review by extempore.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25914 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-31 14:56:56 +00:00
odersky 5f7b400af5 Closes #5127. Review by extempore.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25913 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-31 13:29:10 +00:00
extempore 89b322757a Fix for crasher in explicitouter.
Closes SI-4970, review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25912 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-29 19:35:15 +00:00
extempore 062d046ea9 Test case closes SI-4875.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25911 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-29 19:34:54 +00:00
extempore a2d2c2ef3d Fix ArrayStack.growArray at boundary.
Doubling a 0-size array is still 0, that's not growing.
Closes SI-4963, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25910 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-29 19:34:36 +00:00
extempore 7f55e422fa Fix bug in example sort.
Embarrassing bug causes sort to explode if there are any
duplicated elements.  Closes SI-4961, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25909 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-29 19:34:21 +00:00
extempore d5d36e9a50 Test case closes SI-4957.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25908 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-29 19:34:10 +00:00
extempore 1b9f2bf876 Test case closes SI-102.
No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25907 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-29 19:33:56 +00:00
extempore 9013dcd791 Disabled test.
Guess that was a bad choice of class.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25906 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-29 00:14:26 +00:00
extempore 93917da0a4 Overhaul of getter/setter synthesis.
It represents a lot of work because the mutation flies fast and
furious and you can't even blink at these things without upsetting
them.  They're a little hardier now, or at least we stand a better
chance of changing them.  Open season on review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25905 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-28 23:22:38 +00:00
odersky 44a1737773 Tentative fix for IDE #1000663. Needs to be confirmed that it works. Review by mirco.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25904 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-28 16:48:58 +00:00
odersky 564006a473 Closes t5121. Review by szeiger.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25903 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-28 16:24:38 +00:00
extempore 2f04a3011e Repl output fix.
Don't truncate errors or warnings.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25902 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-28 02:54:01 +00:00
extempore ac650f069f Better report on missing methods.
Discovered an overloaded method with multiple unimplemented variants
only had one listed.  Fixed, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25901 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-28 02:43:59 +00:00
extempore cdd09517f6 Fix for varargs methods.
Propagate varargs flag from object methods to static forwarders
so java will recognize them as varargs.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25900 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-27 18:30:09 +00:00
odersky 10641a9d7a Hopefully a fix for the hyperlinking problem. Review by mirco.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25899 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-27 17:27:22 +00:00
odersky d129c6d942 Fixed problem when running under -Xcheckinit for the code.scala test by avoiding accessing an unitialized variable. Good catch, -Xcheckinit! Review by extempore.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25894 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-25 16:24:56 +00:00
extempore fd222c41ea Some readability for typer.
"phase.id <= currentRun.typerPhase.id" hurts my brain in all
these convoluted conditionals.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25893 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-25 13:40:58 +00:00
odersky cd7f82686f First end-to-end implementation of a runtime reflexive compiler that generates and loads bytecodes. Review by szeiger.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25891 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 16:34:55 +00:00
odersky cd23fa405d Trying to fix getLinkPos problem reported by Mirco. Review by dotta.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25890 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 15:16:37 +00:00
extempore e0a3671a47 Test case for SI-1100/SI-5108.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25889 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 14:19:59 +00:00
Mirco 1f6e5f6a0f Reverted r25886. Martin will take a look at it as it needs more involved rework.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25888 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 14:11:57 +00:00
extempore 9b4e6c6e30 Added a -Yno-productN option.
Suppresses ProductN parent for case classes.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25887 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 14:11:20 +00:00
Mirco dd798a1c89 Fixes IDE ticket #1000692. When performing 'getLinkPos' we need to make sure that the source file containing the definition of the symbol referenced by the link is correctly tracked by the presentation compiler. review by odersky, dragos.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25886 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 12:43:55 +00:00
odersky 36e7249747 Changed typo on doc of scala.collection.Seq. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25885 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 09:27:29 +00:00
odersky 8f26dfa1d1 Pushed NPE defense in NoSourceFile.file out another level.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25884 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 09:27:02 +00:00
odersky 81108a5239 made compileUnits work from given start phase. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25882 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-24 09:26:17 +00:00
extempore ec9f0a68c3 Fix for combinator regression.
Propagate Error in repN. I have no time for a test case, I will gladly
take a contribution. References SI-1100, Closes SI-5108, No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25881 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-23 18:12:56 +00:00
extempore 590435dd1b Debugging note.
Pinpointed line which gave us SI-3882.  In case a remedy
suggest itself to you, review by dragos.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25880 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-23 04:39:57 +00:00
extempore adeab664d4 Overhaul of Namers continues.
Starting to see a glimmer of the other side now.  I nudged
a few things into more sensible places.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25879 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-22 21:09:11 +00:00
michelou 9f512b76a8 fixed svn props in test directory
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25877 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-22 14:13:37 +00:00
extempore 49df475190 Warn about surprising shadowing.
It's hidden behind -Xlint and pretty specific, but makes me feel
better anyway.  References SI-4762, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25875 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-22 05:06:57 +00:00
extempore 259a03d9c4 Positions fix.
One little tiny oversight, those positions are finicky.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25874 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-22 03:13:47 +00:00
extempore a92d2c1619 Test case closes SI-5105, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25873 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-21 23:58:53 +00:00
extempore 4a9f0e8416 More overhaul of Namers.
I was hoping to be further than this by now ("Accursed mutants!" *shakes fist*)
but you can't deny we've come a long way.  Review is welcome, but no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25872 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-21 23:54:29 +00:00
extempore 5319275139 Disabled failing "code" test.
This has been failing the Xcheckinit build for weeks and is now
failing the regular build too.  I'm checking in some hairy stuff and
I'd like to make a good impression on it.  Review by odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25871 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-21 22:59:31 +00:00
extempore 80abff78a5 Overhaul of Namers.
A digression into motivations:

It's not there yet but the future looks bright.  I have winnowed
the number of mutation points down and I will take it down much
further.  There are only a few fundamental state changes which
take place and these can be made to happen in a systematic fashion
at well-known junctions.

  1) Fresh symbols are allocated and (usually) assigned to a tree.
  2) Symbol flags and access are manipulated.
  3) A (possibly lazy) info is assigned to a symbol.
  4) Synthetics are created or lazily positioned for creation

Among the complications is that the symbol's info often cannot be
determined in a straightforward fashion lest cycles develop. Type
inference is obviously dependent on having some type information, so the
black art is to pursue a) only the right information and b) only as far
as necessary to avoid cycles.

Compounding the difficulty is that synthetic methods must be introduced
before the typer phase. Over time a variety of ad-hoc mechanisms have
evolved to deal with these difficulties, and they have gotten us a good
distance (we have bean setter/getters, case classes, copy methods,
default getters, and more) but there are big disadvantages:

 - they are heavily custom fitted to the specific uses
 - because of the intertwingling of namer and typer, it is all
   only possible from the inside.  Compiler plugins are shut out.

A particularly difficult scenario has recently arisen with case classes.
They now receive a ProductN parent, but because a class's parents must
be completed before it can be completed, we encounter this:

  object Foo { type T = String }
  case class Foo(x: Foo.T, y: Foo.T) { }

Now one of class Foo's parents is Product2[T, T]. So class Foo cannot be
completed without information from object Foo. But object Foo needs to
be given these synthetic methods:

  def apply(x: T, y: T): Foo
  def unapply(x: Foo): Option[(T, T)]

You can see these two have their hands all over one another.

The good news is that I have established in principle that the problem
can be overcome, for that use and I think in a sufficiently general way
that plugins will be able to perform this kind of method synthesis,
with the following approach. For synthetic methods which require type
information before they can be created (this is the catch-22: once type
information is available, it's too late to add new synthetic methods) we
create a "stub symbol" like so:

  val sym = owner.newMethod("nameOfMethod")
  sym setInfo stubMethodInfo

stubMethodInfo will be some very general method type like Any* => Any
(or Nothing => Any, it really depends on how or whether it is used),
whatever it takes to pass type checking. At the same time, we enter the
stub symbol into a map along with a thunk which creates the symbol and
tree the way we would if we had full type information.

Then, immediately after a class is typed, the template is examined for
stub method symbols and when found, they are updated with the symbol info
found in the map, assigned to the associated tree, and added to the
class template.  This approach will probably break down under some
uses, but I think it can take us a long way.

So all these changes in Namers are about evolving it to a point where I
can roll out a principled division of responsibility for those entities
which cannot be naively typed, and to unify the several different
approaches to lazy typing under a consistent and predictable mechanism.

If anyone would like to review this, please be my guest, but you might
want to wait one more commit.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25870 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-21 16:27:23 +00:00
odersky 335f313e30 Towards runtime code generation. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25869 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-21 16:05:48 +00:00
odersky f3d45488fc Isolated name change. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25868 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-21 16:05:26 +00:00
moors 8747823041 made virtpatmat codegen type-directed
iff the matching monad is Option (the default MatchingStrategy),
optimize flatMap/orElse/guard to the equivalent if-then-else
(otherwise, emit flatMap/orElse,... calls)

also, triggering support for <outer> when opt.virtPatmat (was opt.experimental)

no review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25867 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-21 16:05:19 +00:00
moors ec233e4e93 virtpatmat, hidden behind -Yvirtpatmat
at least one imminent TODO: undo hardwired generation of if/then/else,
and decide based on type whether to call flatMap/orElse or inline those methods from Option

review by extempore

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25866 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:29:20 +00:00
moors abe4c8a12a explicitouter support for virtpatmat synthetic <outer> is turned into the actual outer accessor since pattern matching virtualisation is done during typer, not explicitouter like the real pattern matcher, we don't know what the outerAccessor is yet when emitting outer checks -- thus use a synthetic select that is transformed into the real thing during explicitouter
no review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25865 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:29:13 +00:00
moors 7c9515d45a setting the stage for the virtualizing pattern matcher no actual changes though
no review

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25864 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-10-20 22:29:09 +00:00