@@ -282,7 +282,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
282282
283283 def Ident_name (self : Ident ) given Context : String = self.name.show
284284
285- def Ident_apply (tmref : NamedTermRef ) given Context : Term =
285+ def Ident_apply (tmref : TermRef ) given Context : Term =
286286 withDefaultPos(tpd.ref(tmref).asInstanceOf [Term ])
287287
288288 def Ident_copy (original : Tree )(name : String ) given Context : Ident =
@@ -1114,6 +1114,8 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
11141114
11151115 def Type_typeSymbol (self : Type ) given Context : Symbol = self.typeSymbol
11161116
1117+ def Type_termSymbol (self : Type ) given Context : Symbol = self.termSymbol
1118+
11171119 def Type_isSingleton (self : Type ) given Context : Boolean = self.isSingleton
11181120
11191121 def Type_memberType (self : Type )(member : Symbol ) given Context : Type =
@@ -1148,46 +1150,27 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
11481150 type TermRef = Types .NamedType
11491151
11501152 def matchTermRef (tpe : TypeOrBounds ) given Context : Option [TermRef ] = tpe match {
1151- case tp : Types .NamedType =>
1152- tp.designator match {
1153- case sym : Symbol if sym.isTerm => Some (tp)
1154- case _ => None
1155- }
1153+ case tp : Types .TermRef => Some (tp)
11561154 case _ => None
11571155 }
11581156
1157+ def TermRef_apply (qual : TypeOrBounds , name : String ) given Context : TermRef =
1158+ Types .TermRef (qual, name.toTermName)
1159+
11591160 def TermRef_qualifier (self : TermRef ) given Context : TypeOrBounds = self.prefix
11601161
1161- def matchTermRef_unapply (tpe : TypeOrBounds ) given Context : Option [(Symbol , Type | NoPrefix )] = tpe match {
1162- case tpe : Types .NamedType =>
1163- tpe.designator match {
1164- case sym : Symbol if sym.isTerm => Some ((sym, tpe.prefix))
1165- case _ => None
1166- }
1167- case _ => None
1168- }
1162+ def TermRef_name (self : TermRef ) given Context : String = self.name.toString
11691163
11701164 type TypeRef = Types .NamedType
11711165
11721166 def matchTypeRef (tpe : TypeOrBounds ) given Context : Option [TypeRef ] = tpe match {
1173- case tp : Types .NamedType =>
1174- tp.designator match {
1175- case sym : Symbol if sym.isType => Some (tp)
1176- case _ => None
1177- }
1167+ case tp : Types .TypeRef => Some (tp)
11781168 case _ => None
11791169 }
11801170
11811171 def TypeRef_qualifier (self : TypeRef ) given Context : TypeOrBounds = self.prefix
11821172
1183- def matchTypeRef_unapply (tpe : TypeOrBounds ) given Context : Option [(Symbol , Type | NoPrefix )] = tpe match {
1184- case tpe : Types .NamedType =>
1185- tpe.designator match {
1186- case sym : Symbol if sym.isType => Some ((sym, tpe.prefix))
1187- case _ => None
1188- }
1189- case _ => None
1190- }
1173+ def TypeRef_name (self : TypeRef ) given Context : String = self.name.toString
11911174
11921175 type NamedTermRef = Types .NamedType
11931176
@@ -1203,23 +1186,6 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
12031186 def NamedTermRef_name (self : NamedTermRef ) given Context : String = self.name.toString
12041187 def NamedTermRef_qualifier (self : NamedTermRef ) given Context : TypeOrBounds = self.prefix
12051188
1206- def NamedTermRef_apply (qual : TypeOrBounds , name : String ) given Context : NamedTermRef =
1207- Types .TermRef (qual, name.toTermName)
1208-
1209- type NamedTypeRef = Types .NamedType
1210-
1211- def matchNamedTypeRef (tpe : TypeOrBounds ) given Context : Option [NamedTypeRef ] = tpe match {
1212- case tpe : Types .NamedType =>
1213- tpe.designator match {
1214- case name : Names .TypeName => Some (tpe)
1215- case _ => None
1216- }
1217- case _ => None
1218- }
1219-
1220- def NamedTypeRef_name (self : NamedTypeRef ) given Context : String = self.name.toString
1221- def NamedTypeRef_qualifier (self : NamedTypeRef ) given Context : TypeOrBounds = self.prefix
1222-
12231189 type SuperType = Types .SuperType
12241190
12251191 def matchSuperType (tpe : TypeOrBounds ) given Context : Option [SuperType ] = tpe match {
0 commit comments