summaryrefslogtreecommitdiff
path: root/src/continuations
Commit message (Collapse)AuthorAgeFilesLines
* Tighten the CPS plugin constraints.Iulian Dragos2011-09-071-0/+1
|
* applying patch provided by Topher, fixes #3501.Tiark Rompf2011-08-231-1/+4
|
* Reversed the values of "is" and "is not" in rec...Paul Phillips2011-08-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Reversed the values of "is" and "is not" in recent for comprehension deprecation. DO NOT BLOW HATCH REPEAT DO NOT BLOW HATCH "Roger! Hatch blown." Events reveal it was all baby, no bathwater. It turns out that the specification is merely a document, not infallible holy writ as we had all previously believed. So it is not the ABSENCE of val in a for comprehension assignment which is deprecated, it is the PRESENCE of val. Summarizing again, more accurately perhaps: for (x <- 1 to 5 ; y = x) yield x+y // THAT's the one for (val x <- 1 to 5 ; y = x) yield x+y // fail for (val x <- 1 to 5 ; val y = x) yield x+y // fail for (x <- 1 to 5 ; val y = x) yield x+y // deprecated No review.
* Beginning to document scala.util.continuations ...Paul Phillips2011-07-151-2/+62
| | | | | | | Beginning to document scala.util.continuations with a use case. Authored by Chris League and Roland Kuhn.
* Adding some Sets/Maps to perRunCaches, and elim...Paul Phillips2011-07-141-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Adding some Sets/Maps to perRunCaches, and eliminating ambiguously named imports. Did a tour of the compiler adding a few longer-lived mutable structures to the per-run cache clearing mechanism. Some of these were not a big threat, but there is (almost) literally no cost to tracking them and the fewer mutable structures which are created "lone wolf style" the easier it is to spot the one playing by his own rules. While I was at it I followed through on long held ambition to eliminate the importing of highly ambiguous names like "Map" and "HashSet" from the mutable and immutable packages. I didn't quite manage elimination but it's pretty close. Something potentially as pernicious which I didn't do much about is this import: import scala.collection._ Imagine coming across that one on lines 407 and 474 of a 1271 file. That's not cool. Some poor future programmer will be on line 1100 and use "Map[A, B]" in some function and only after the product has shipped will it be discovered that the signature is wrong and the rocket will now be crashing into the mountainside straightaway. No review.
* Refactored reflection into reflect.api and refl...Martin Odersky2011-07-111-1/+1
| | | | | | Refactored reflection into reflect.api and reflect.internal. Severed the last remaining dependency on reflect.generic. Review by extempore.
* Fixes #4490 and #4467.Kato Kazuyoshi2011-06-182-2/+2
|
* introduce NullaryMethodType to disambiguate Pol...Adriaan Moors2011-01-202-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Warded off an NPE (which only arose on erroneou...Paul Phillips2011-01-091-4/+4
| | | | | | Warded off an NPE (which only arose on erroneous code) in the continuations plugin. Closes #4132, no review.
* Eliminating all possible warnings from trunk.Paul Phillips2010-12-111-3/+3
| | | | | | | one deprecation, one unchecked, and one "other", each of which volunteers no mechanism for suppression. (It would be nice to change this.) No review.
* Moved ClassfileAnnotation/StaticAnnotation/Anno...Paul Phillips2010-12-061-2/+2
| | | | | | | Moved ClassfileAnnotation/StaticAnnotation/Annotation/TypeConstraint into scala.annotation and enabled the deprecated type aliases in scala.* to point there. Also enclosed is a new starr to bootstrap. No review.
* Mopping up after the deprecation of exit and er...Paul Phillips2010-12-052-2/+2
| | | | | | | | | | | | | | Mopping up after the deprecation of exit and error. It is decidedly non-trivial (at least for the IDE-impaired) to be completely sure of which error function was being called when there were about twenty with the same signature in trunk and they are being variously inherited, imported, shadowed, etc. So although I was careful, the possibility exists that something is now calling a different "error" function than before. Caveat programmer. (And let's all make it our policy not to name anything "error" or "exit" from here on out....) No review.
* Deprecation patrol.Paul Phillips2010-11-081-1/+1
| | | | | | | | | the same issues as JavaConversions with respect to overloading implicit methods making them inaccessible to view bounds. Fixed JavaConverters. Added a warning for when people overload parameterized implicits: in almost all cases the name is irrelevant so there's little point in unwittingly suffering degraded functionality. No review.
* Determined that half a dozen ways of checking f...Paul Phillips2010-11-042-2/+2
| | | | | | | | | | | Determined that half a dozen ways of checking for varargs and by-name-ness in param lists exceeded the legal limit. Also assessed that names which are only used as type names would be a lot easier to deal with if we created them as type names up front. Performed the changes implied by the preceding along with a partial cleanup on TreeInfo which one can see hasn't had a good look in a long time. (And still hasn't.) No review.
* The inliner now looks harder for method impleme...Paul Phillips2010-06-162-2/+2
| | | | | | | | | The inliner now looks harder for method implementations. In addition to the receiver, it will find those in directly mixed in traits and in superclasses. It still won't find those in traits mixed only into superclasses, as that didn't come quite so easily. Closes #3234 but I'll be opening up another ticket. Review by dragos.
* Changed TreeSymSubstituter from a traverser toIulian Dragos2010-04-092-11/+11
| | | | | | | | transformer. It now aligns tree nodes that contain names to the symbol name that was substituted. Before this change identifiers may refer to one symbol, while the name they carry would resovlve to another one.
* workaround for #3252. review by extempore.Tiark Rompf2010-04-041-2/+2
|
* improved cps transform of partial functions.Tiark Rompf2010-04-032-71/+64
|
* fixes the unfounded "name clash between inherit...Tiark Rompf2010-03-292-1/+3
| | | | | | fixes the unfounded "name clash between inherited members" error. review by dragos.
* closes 2864.Tiark Rompf2010-03-294-25/+70
|
* improvements to cps exception handling.Tiark Rompf2010-03-265-38/+163
|
* fixed double-loading of plugins.Tiark Rompf2010-03-252-3/+6
|
* reverting changes from r21260.Tiark Rompf2010-03-241-5/+1
|
* continuations plugin will now report a nice err...Tiark Rompf2010-03-241-1/+5
| | | | | | continuations plugin will now report a nice error message if it is not enabled and encounters an @cps expression. review by rytz
* Renamed partialMap to collect.Paul Phillips2010-03-241-3/+3
| | | | | | | | | method on Iterator called collect which I had to remove, because if the method is overloaded it puts a bullet in the type inference, an intolerable result for a function which takes a partial function as its argument. I don't think there's much chance of confusion, but I put a migration warning on collect just in case. No review.
* closes #3199. review by community.Tiark Rompf2010-03-221-1/+4
|
* added support for continuations in try/catch bl...Tiark Rompf2010-03-165-24/+126
| | | | | | added support for continuations in try/catch blocks. review by community.
* added missing file from last commit. no review.Tiark Rompf2010-03-111-0/+60
|
* moved the continuations plugin into trunk.Tiark Rompf2010-03-117-0/+1349