summaryrefslogtreecommitdiff
path: root/test/files/run/repl-power.check
Commit message (Collapse)AuthorAgeFilesLines
* repl power mode improvements.Paul Phillips2011-12-281-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented great suggestion from moors. More imports in power mode, including the contents of treedsl. Also, another swing at overcoming the mismatched global singletons problem, this time taking advantage of dependent method types. Amazingly, it seems to work. Continuing in the quest to create a useful compiler hacking environment, there is now an implicit from Symbol which allows you to pretend a Symbol takes type parameters, and the result is the applied type based on the manifests of the type arguments and the type constructor of the symbol. Examples: // magic with manifests scala> val tp = ArrayClass[scala.util.Random] tp: $r.global.Type = Array[scala.util.Random] // evidence scala> tp.memberType(Array_apply) res0: $r.global.Type = (i: Int)scala.util.Random // treedsl scala> val m = LIT(10) MATCH (CASE(LIT(5)) ==> FALSE, DEFAULT ==> TRUE) m: $r.treedsl.global.Match = 10 match { case 5 => false case _ => true } // typed is in scope scala> typed(m).tpe res1: $r.treedsl.global.Type = Boolean
* Making power mode startup a little less glacial...Paul Phillips2011-07-121-1/+1
| | | | | Making power mode startup a little less glacial, no review.
* A bunch of repl stuff.Paul Phillips2011-07-121-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | type mismatches, for real this time. :power mode goes to phase typer automatically. You can get the symbols for repl-defined names more directly: scala> case class Bippy(x: Int) defined class Bippy scala> intp.terms("Bippy") res1: intp.global.Symbol = object Bippy scala> intp.types("Bippy") res2: intp.global.Symbol = class Bippy scala> intp("Bippy") // tries type first res3: intp.global.Symbol = class Bippy scala> intp("scala.collection.Map") // falls back to fully qualified res4: intp.global.Symbol = trait Map I changed the implicit which used to install "tpe" and "symbol" to install "tpe_" and "symbol_" because it was too easy to do something you didn't mean to, like calling x.tpe where x is a Manifest. Said implicit now handles manifest type arguments, so you can get the full translation from a manifest representation to a compiler type, at least for simple types and only as much as manifests work, which is not that much. Fortunately that situation is all changing soon. scala> List(List(1, 2, 3)).tpe_ res5: power.Type = List[List[Int]] scala> res5.typeArgs res6: List[power.global.Type] = List(List[Int]) Review by moors.
* More polishing up repl power mode, no review.Paul Phillips2011-06-031-1/+0
|
* Cleaning up power mode import issues (and the a...Paul Phillips2011-05-311-0/+18
Cleaning up power mode import issues (and the amazing first power mode test) no review.