The semantic APIs are mostly driven by macro use cases
The semantic APIs minimises assumptions on compiler internals
Instead of the concept Symbol, we find Member is more understandable
/** are the two types equal? */
def =:=(tp1: Type, tp2: Type): Boolean
/** is `tp1` a subtype of `tp2` */
def <:<(tp1: Type, tp2: Type): Boolean
/** returning a type referring to a type definition */
def typeRef(path: String): Type
/** returning a type referring to a value definition */
def termRef(path: String): Type
/** type associated with the tree */
def typeOf(tree: Tree): Type
/** does the type refer to a case class? */
def isCaseClass(tp: Type): Boolean
/** val fields of a case class Type -- only the ones declared in primary constructor */
def caseFields(tp: Type): Seq[Member]
/* field with the given name */
def field(tp: Type, name: String): Option[Member]
/** name of a member */
def name(mem: Member): String
/** type of a member with respect to a prefix */
def asSeenFrom(mem: Member, prefix: Type): Type
Fix #48: Implement first set of semantic APIs.
Symbol
, we findMember
is more understandable