Intent
I am trying to add support for :kind command to scala repl. Thanks to Eugene Burmako, I was able to get a working prototype. Though it only works with fully qualified names and fails to resolve imported names.
I am now trying to use IMain.exprTyper to do the job, as it is aware of types, imported into the repl. But there is a problem. Everything I've tried returns a ClassInfoType like the following (displayed with showRaw):
ClassInfoType(List(TypeRef(TypeRef(TypeRef(TypeRef(NoPrefix(), package <root>, List()), package java, List()), package lang, List()), class Object, List()), TypeRef(TypeRef(TypeRef(NoPrefix(), package <root>, List()), package scala, List()), trait Serializable, List())), Scope{
def <init>(): Option.type;
implicit def option2Iterable(xo: Option): Iterable;
def apply(x: Object): Option;
def empty(): Option;
private def readResolve(): Object
}, object Option)
While the working implementation returns specific Type:
PolyType(List(TypeName("A")), ClassInfoType(List(TypeRef(ThisType(scala), TypeName("AnyRef"), List()), TypeRef(ThisType(scala), scala.Product, List()), TypeRef(ThisType(scala), scala.Serializable, List())), Scope(nme