|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|