Commit Graph

13350 Commits

Author SHA1 Message Date
dragos 9c215faff7 Added presentation compiler tests. review by phaller, extempore.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24075 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-24 19:17:32 +00:00
dragos e2ccd40f32 Updated project files.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24074 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-24 19:17:29 +00:00
odersky ef8511680c Better behavior on completions. More log infos. Added onTypeError operator to make presentation compiler more robust.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24073 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-24 16:40:32 +00:00
dubochet 06b26b9f9c [scaladoc] Fixed failing test.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24072 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-24 14:11:52 +00:00
odersky ff329c2a1b Responds no longer re-throw exceptions.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24071 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-24 12:11:34 +00:00
odersky 9718488842 made DivergentImplicit a def so we see what goes wrong lately in Eclipse.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24070 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-24 11:24:37 +00:00
odersky 24a86302bb Added log message to tell what version of the presentation compiler is running.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24069 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-24 10:49:17 +00:00
extempore 0d7d9bc5f4 The AnyVal types become source files instead of polite
compiler fictions.

!! You'll need a serious "ant all.clean" now. !!

As of this commit the system is fully bootstrapped and the
synthetic code eliminated: only the source files remain.
The sort-of-AnyVal-companions in scala.runtime.* have all
been eliminated because the actual companions can do everything;
deprecated vals in the scala.runtime package object point to
the companions.  This left AnyValCompanion as the only AnyVal
related thing in the runtime package: that made little sense,
so I deprecated and moved it as well.

Starr is based on r24066 plus this commit.  Closes #4121.
Review by rytz, odersky.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24068 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-24 06:18:01 +00:00
extempore ebe3e42684 Tackled source generation from a new angle rather than letting
genprod get any more creaky.  This code generates the AnyVal
source files (but those are not included here.) No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24066 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-23 23:06:28 +00:00
odersky 0d9e087dfd Using decoded names in invokeDynamic.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24065 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-23 15:16:29 +00:00
odersky 7a323f488e hardeing of the presentation compiler. See ComplerControl doc comment for usage instructions.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24064 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-23 15:15:30 +00:00
extempore 052e2fadc6 Taking a ride from 106 invalid generic signatures to zero.
Closes #4067.

Numbers 1-72:
Problem: Primitive types appearing in generic bounds.
Response: Use the boxed types.

Numbers 73-105:
Problem: Doubly nested classes can become Outer<T>.Inner.Inner2
Response: Don't allow dots except immediately following angle brackets.

Number 106:
Problem: Array may be being used as a higher kinded type,
and in such cases should not receive the special Array treatment.
Solution: args.nonEmpty

Observe my claim is that 106/106 signatures have been made
"valid", not "correct" or even "more nearly correct." As to that
I would like a second opinion.  And.... review by moors!

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24063 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-23 04:56:53 +00:00
extempore c9ba392274 Disabled failing test, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24062 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-23 04:36:07 +00:00
extempore 8e1b3a42ed Incorporated feedback on a couple recent commits. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24060 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-22 19:26:04 +00:00
extempore 56190dc123 Merge branch 'invalid-sig' of /scala/trunk
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24059 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-22 19:05:46 +00:00
Paul Phillips 2d1b65d9b4 In light of the difficulties described in ticket #4067 and
at https://bugs.eclipse.org/bugs/show_bug.cgi?id=332423 I have
turned on generic signature validation for all builds and when
an invalid signature is encountered I suppress it completely.
The -Yverify-generics option still exists, but now it only means
to echo a message for every bad signature.

It would obviously be better not to generate them in the first
place, but we should never be generating broken bytecode like
this.  Review by odersky.
2011-01-22 10:52:20 -08:00
Joshua.Suereth 52cd3694a6 Modified scala build to push jline artifact to maven repositories. Review by: extempore
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24058 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-22 17:12:25 +00:00
extempore fc4126160a Updated to new jline sources with it moved into scala.tools.jline.
I transitioned the jline build from maven to sbt, and this commit
includes the first sbt-built binary.  Review by jsuereth.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24055 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 18:40:25 +00:00
dubochet 607423421f [scaladoc] First attempt at modularisation of Scaladoc generator. Option "docgenerator" controls which generation backend is called. No review for now; needs a discussion.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24054 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 17:31:29 +00:00
dubochet 1bcae4fc2d [scaladoc] Fixes issue with code block in scaladoc attribute (which were wrongly attributed to main comment, instead of attribute). Review by pedrofurla.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24053 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 17:28:50 +00:00
odersky e38393ac99 getLinkPos now removes the unit it loaded.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24052 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 15:41:19 +00:00
odersky 1c0d75d90a Trying to fix problem in getLinkPos.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24051 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 15:12:58 +00:00
odersky 35db0b174c Better replays. background compiler now properly invalidates previously computed units.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24050 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 15:02:37 +00:00
extempore 397311987c The empty string commit made me hungry to actually know what's in
stuff.  Now it prints quotes around a string if it's empty or if either
the first or last character is whitespace.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24048 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 05:03:42 +00:00
extempore 015d3be4c1 Deleted the former Process code in the compiler. Converted those
things which used it to use sys.process.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24047 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 05:03:21 +00:00
extempore 656d3fd2ff A little debugging infrastructure for sys.process. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24046 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-21 05:02:52 +00:00
extempore 9489a5e031 Minor collections cleanups, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24044 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 23:19:14 +00:00
extempore 8423735598 Defer a check from the typer to refcheck so the error message
makes some sense.  Closes #4174, review by rytz.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24043 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 23:18:51 +00:00
extempore 8cf68bbadf Integrated contributed non-recursive implementation of permutations,
combinations, subsets, by EastSun.  Also gave mutable Seqs an
in-place transform method like the one Map has.  And couldn't
resist slightly reformulating a few set methods, because how can we
settle for "forall(that.contains)" when we could have "this forall that".
(Which is also what normal people hear when we talk about sets.)

Closes #4060, #3644, review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24042 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 20:49:03 +00:00
extempore 1e2ef90b5f Made the empty string print as "" in the repl instead of as nothing.
This after being misled one too many times by a variation of this:

scala> List[String]()
res1: List[String] = List()

scala> List[String]("")
res2: List[String] = List()

No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24041 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 20:48:38 +00:00
extempore f45fae2e96 The repl becomes more intense about making sure you wanted file
completion before offering it.  Closes #4130, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24040 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 18:25:47 +00:00
extempore 1240985783 Made partest update a checkfile even if it doesn't exist. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24039 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 18:19:47 +00:00
extempore 3ab4557c8d Look even harder for attempts to sneak "this" into superconstructor
arguments, and improve positioning.  Closes #4166, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24038 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 18:19:28 +00:00
extempore 30277b66e0 Duplication elimination, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24036 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 16:19:51 +00:00
odersky 52ca60aead Added askLinkPos command for hyperlinking.
Fixed a problem noted by Iulian in completion.
Review by vigdorchik

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24035 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 16:19:40 +00:00
extempore 2aca7ea673 Made ().## and null.## not crash anymore. Closes #4074, review by moors.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24034 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 16:19:27 +00:00
cunei 92723eeb9e Fixing the svn:mime-type of a few jars.
They should be marked as binary files in svn:

svn propset svn:mime-type application/java-archive [...files...]



git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24033 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 15:59:43 +00:00
cunei eb642f6633 Updated copyright notices to 2011
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24032 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 15:32:51 +00:00
moors f889169764 introduce NullaryMethodType to disambiguate PolyType
motivation:
given `def foo[T]: (T, T)` and `type Foo[T] = (T, T)`,

`foo.info` and `TypeRef(_, Foo, Nil).normalize` are both `PolyType(List(T), Pair[T, T])`

uncurry has been relying on an ugly hack to distinguish these cases based on ad-hoc kind inference
without this distinction, the type alias's info (a type function) would be transformed to `PolyType(List(T), MethodType(Nil, Pair[T, T]))`

anonymous type functions are being used more often (see #2741, #4017, #4079, #3443, #3106), which makes a proper treatment of PolyTypes more pressing

change to type representation:
PolyType(Nil, tp) -> NullaryMethodType(tp)
PolyType(tps, tp) -> PolyType(tps, NullaryMethodType(tp)) (if the polytype denoted a polymorphic nullary method)

PolyType(Nil, tp) is now invalid

the kind of a PolyType is * iff its resulttype is a NullaryMethodType or a MethodType (i.e., it's a polymorphic value)
in all other cases a PolyType now denotes a type constructor

NullaryMethodType is eliminated during uncurry

pickling:
for backwards compatibility, a NullaryMethodType(tp) is still pickled as a PolyType(Nil, tp),
unpickling rewrites pre-2.9-pickled PolyTypes according to the expected kind of the unpickled type (similar to what we used to do in uncurry)
a pickled PolyType(Nil, restpe) is unpickled to NullaryMethodType(restpe)
a pickled PolyType(tps, restpe) is unpickled to PolyType(tps, NullaryMethodType(restpe)) when the type is expected to have kind *

the rewrite probably isn't complete, but was validated by compiling against the old scalacheck jar (which has plenty of polymorphic nullary methods)
nevertheless, this commit includes a new scalacheck jar

summary of the refactoring:
* PolyType(List(), tp) or PolyType(Nil, tp) or PolyType(parms, tp) if params.isEmpty ==> NullaryMethodType(tp)
* whenever there was a case PolyType(tps, tp) (irrespective of tps isEmpty), now need to consider the
  case PolyType(tps, NullaryMethodType(tp)); just add a case NullaryMethodType(tp), since usually:
    - there already is a PolyType case that recurses on the result type,
    - the polytype case applied to empty and non-empty type parameter lists alike
* tp.resultType, where tp was assumed to be a PolyType that represents a polymorphic nullary method type
  before, tp == PolyType(tps, res), now tp == PolyType(tps, NullaryMethodType(res))

* got bitten again (last time was dependent-method types refactoring) by a TypeMap not being the identity when dropNonConstraintAnnotations is true (despite having an identity apply method). Since asSeenFrom is skipped when isTrivial, the annotations aren't dropped. The cps plugin relies on asSeenFrom dropping these annotations for trivial types though. Therefore, NullaryMethodType pretends to never be trivial. Better fix(?) in AsSeenFromMap: `if(tp.isTrivial) dropNonContraintAnnotations(tp) else ...`

TODO: scalap and eclipse

review by odersky, rytz

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24029 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-20 09:43:18 +00:00
dragos ce2a75e29e Updated check file for namesdefault test. no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24027 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-19 23:16:28 +00:00
extempore 7bcd81db6f More on partest. Deletes a bunch of code. Fixes the
multiple-reporting-of-failures bug.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24026 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-19 22:38:16 +00:00
dragos c044196f55 Removed the probe for integers in spec-matrix. Should fix the optimized build. no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24025 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-19 21:52:08 +00:00
odersky 2899fd0d26 Fixed First/Second dependency problem in presentation compiler.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24024 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-19 15:33:57 +00:00
extempore 5746dfc0b5 Simplifying some partest internal structure. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24022 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-19 03:54:08 +00:00
extempore 3c701c836f Moved and removed a bunch of tests from pending. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24021 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-19 03:53:44 +00:00
extempore c82fae7d76 There was a bunch of work adriaan and I did which ended up in some
git backwaters.  I think he is still working with the main code pieces
but I didn't want to lose a couple comments/clarifications.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24020 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-19 03:53:15 +00:00
extempore 42e9ae0c38 Made recent string optimization jvm-only. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24019 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-19 03:52:54 +00:00
extempore c96b744689 One element of the partest situation: Reporting and recovering
correctly when the compiler crashes.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24017 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-18 20:00:44 +00:00
extempore 0e20c8410d What is, I think, the only possible solution to bug #4158 given the
current ways of controlling implicits.  Let's just be glad there's one
instead of zero.  Closes #4158, review by moors.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24016 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-18 18:54:27 +00:00
extempore 56aab97ccc Added a terminal type for echo reenable based on #4170. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24015 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
2011-01-18 17:59:41 +00:00