1- object tasty {
1+ package tasty
2+
3+ object definitions {
24
35// ------ Names --------------------------------
46
@@ -8,16 +10,13 @@ object tasty {
810 enum TermName extends Name with PossiblySignedName {
911 case Simple (str : String )
1012 case Qualified (prefix : TermName , selector : String ) // s"$prefix.$name"
11- case Unique ( underlying : TermName , separator : String , idx : Int ) // s"$underlying$separator$idx"
13+
1214 case DefaultGetter (methodName : TermName , idx : String ) // s"$methodName${"$default$"}${idx+1}"
1315 case Variant (underlying : TermName , covariant : Boolean ) // s"${if (covariant) "+" else "-"}$underlying"
1416 case SuperAccessor (underlying : TermName ) // s"${"super$"}$underlying"
1517 case ProtectedAccessor (underlying : TermName ) // s"${"protected$"}$underlying"
1618 case ProtectedSetter (underlying : TermName ) // s"${"protected$set"}$underlying"
1719 case ObjectClass (underlying : TermName ) // s"$underlying${"$"}"
18-
19- case Expanded (prefix : TermName , selector : String ) // s"$prefix${"$$"}$name" , used only for symbols coming from Scala 2
20- case ExpandedPrefix (prefix : TermName , selector : String ) // s"$prefix${"$"}$name" , used only for symbols coming from Scala 2
2120 }
2221
2322 case class SignedName (name : TermName , resultSig : TypeName , paramSigs : List [TypeName ]) extends PossiblySignedName
@@ -131,7 +130,7 @@ object tasty {
131130 case class SymRef (sym : Definition , qualifier : Type | NoPrefix = NoPrefix ) extends Type
132131 case class NameRef (name : Name , qualifier : Type | NoPrefix = NoPrefix ) extends Type // NoPrefix means: select from _root_
133132 case class SuperType (thistp : Type , underlying : Type ) extends Type
134- case class Refinement (underlying : Type , name : Name , tpe : Type ) extends Type
133+ case class Refinement (underlying : Type , name : Name , tpe : Type | TypeBounds ) extends Type
135134 case class AppliedType (tycon : Type , args : List [Type | TypeBounds ]) extends Type
136135 case class AnnotatedType (underlying : Type , annotation : Term ) extends Type
137136 case class AndType (left : Type , right : Type ) extends Type
@@ -153,7 +152,7 @@ object tasty {
153152
154153 abstract class LambdaType [ParamName , ParamInfo , This <: LambdaType [ParamName , ParamInfo , This ]](
155154 val companion : LambdaTypeCompanion [ParamName , ParamInfo , This ]
156- ) {
155+ ) extends Type {
157156 private [Type ] var _pinfos : List [ParamInfo ]
158157 private [Type ] var _restpe : Type
159158
@@ -247,28 +246,3 @@ object tasty {
247246 case Enum (v : Type ) extends Constant (v)
248247 }
249248}
250-
251- object Test {
252- import tasty ._
253- import Type ._
254-
255- def show (tp : Type ): String = tp match {
256- case ConstantType (c) => c.value.toString
257- case SymRef (sym, NoPrefix ) => ???
258- case SymRef (sym, t : Type ) => ???
259- case NameRef (name : Name , qualifier) => ???
260- case SuperType (thistp : Type , underlying : Type ) => ???
261- case Refinement (underlying : Type , name : Name , tpe : Type ) => ???
262- case AppliedType (tycon, args) => ???
263- case AnnotatedType (underlying : Type , annotation : Term ) => ???
264- case AndType (left : Type , right : Type ) => ???
265- case OrType (left : Type , right : Type ) => ???
266- case ByNameType (underlying : Type ) => ???
267- case ParamRef (binder, idx) => ???
268- case RecursiveThis (binder : RecursiveType ) => ???
269- case RecursiveType (tp) => ???
270- case MethodType (pnames, ptypes, resType) => ???
271- case PolyType (pnames, ptypes, resType) => ???
272- case TypeLambda (pnames, ptypes, resType) => ???
273- }
274- }
0 commit comments