@@ -568,50 +568,38 @@ func (a *TypeAlias) TypeArguments() []*Type {
568
568
return a .typeArguments
569
569
}
570
570
571
- // Type
572
-
573
- type Type struct {
574
- flags TypeFlags
575
- objectFlags ObjectFlags
576
- id TypeId
577
- symbol * ast.Symbol
578
- alias * TypeAlias
579
- checker * Checker
580
- data TypeData // Type specific data
581
- }
582
-
583
571
// Casts for concrete struct types
584
572
585
- func (t * Type ) AsIntrinsicType () * IntrinsicType { return t .data .(* IntrinsicType ) }
586
- func (t * Type ) AsLiteralType () * LiteralType { return t .data .(* LiteralType ) }
587
- func (t * Type ) AsUniqueESSymbolType () * UniqueESSymbolType { return t .data .(* UniqueESSymbolType ) }
588
- func (t * Type ) AsTupleType () * TupleType { return t .data .(* TupleType ) }
589
- func (t * Type ) AsSingleSignatureType () * SingleSignatureType { return t .data .(* SingleSignatureType ) }
573
+ func (t * Type ) AsIntrinsicType () * IntrinsicType { return t .data () .(* IntrinsicType ) }
574
+ func (t * Type ) AsLiteralType () * LiteralType { return t .data () .(* LiteralType ) }
575
+ func (t * Type ) AsUniqueESSymbolType () * UniqueESSymbolType { return t .data () .(* UniqueESSymbolType ) }
576
+ func (t * Type ) AsTupleType () * TupleType { return t .data () .(* TupleType ) }
577
+ func (t * Type ) AsSingleSignatureType () * SingleSignatureType { return t .data () .(* SingleSignatureType ) }
590
578
func (t * Type ) AsInstantiationExpressionType () * InstantiationExpressionType {
591
- return t .data .(* InstantiationExpressionType )
592
- }
593
- func (t * Type ) AsMappedType () * MappedType { return t .data .(* MappedType ) }
594
- func (t * Type ) AsReverseMappedType () * ReverseMappedType { return t .data .(* ReverseMappedType ) }
595
- func (t * Type ) AsEvolvingArrayType () * EvolvingArrayType { return t .data .(* EvolvingArrayType ) }
596
- func (t * Type ) AsTypeParameter () * TypeParameter { return t .data .(* TypeParameter ) }
597
- func (t * Type ) AsUnionType () * UnionType { return t .data .(* UnionType ) }
598
- func (t * Type ) AsIntersectionType () * IntersectionType { return t .data .(* IntersectionType ) }
599
- func (t * Type ) AsIndexType () * IndexType { return t .data .(* IndexType ) }
600
- func (t * Type ) AsIndexedAccessType () * IndexedAccessType { return t .data .(* IndexedAccessType ) }
601
- func (t * Type ) AsTemplateLiteralType () * TemplateLiteralType { return t .data .(* TemplateLiteralType ) }
602
- func (t * Type ) AsStringMappingType () * StringMappingType { return t .data .(* StringMappingType ) }
603
- func (t * Type ) AsSubstitutionType () * SubstitutionType { return t .data .(* SubstitutionType ) }
604
- func (t * Type ) AsConditionalType () * ConditionalType { return t .data .(* ConditionalType ) }
579
+ return t .data () .(* InstantiationExpressionType )
580
+ }
581
+ func (t * Type ) AsMappedType () * MappedType { return t .data () .(* MappedType ) }
582
+ func (t * Type ) AsReverseMappedType () * ReverseMappedType { return t .data () .(* ReverseMappedType ) }
583
+ func (t * Type ) AsEvolvingArrayType () * EvolvingArrayType { return t .data () .(* EvolvingArrayType ) }
584
+ func (t * Type ) AsTypeParameter () * TypeParameter { return t .data () .(* TypeParameter ) }
585
+ func (t * Type ) AsUnionType () * UnionType { return t .data () .(* UnionType ) }
586
+ func (t * Type ) AsIntersectionType () * IntersectionType { return t .data () .(* IntersectionType ) }
587
+ func (t * Type ) AsIndexType () * IndexType { return t .data () .(* IndexType ) }
588
+ func (t * Type ) AsIndexedAccessType () * IndexedAccessType { return t .data () .(* IndexedAccessType ) }
589
+ func (t * Type ) AsTemplateLiteralType () * TemplateLiteralType { return t .data () .(* TemplateLiteralType ) }
590
+ func (t * Type ) AsStringMappingType () * StringMappingType { return t .data () .(* StringMappingType ) }
591
+ func (t * Type ) AsSubstitutionType () * SubstitutionType { return t .data () .(* SubstitutionType ) }
592
+ func (t * Type ) AsConditionalType () * ConditionalType { return t .data () .(* ConditionalType ) }
605
593
606
594
// Casts for embedded struct types
607
595
608
- func (t * Type ) AsConstrainedType () * ConstrainedType { return t .data .AsConstrainedType () }
609
- func (t * Type ) AsStructuredType () * StructuredType { return t .data .AsStructuredType () }
610
- func (t * Type ) AsObjectType () * ObjectType { return t .data .AsObjectType () }
611
- func (t * Type ) AsTypeReference () * TypeReference { return t .data .AsTypeReference () }
612
- func (t * Type ) AsInterfaceType () * InterfaceType { return t .data .AsInterfaceType () }
596
+ func (t * Type ) AsConstrainedType () * ConstrainedType { return t .data () .AsConstrainedType () }
597
+ func (t * Type ) AsStructuredType () * StructuredType { return t .data () .AsStructuredType () }
598
+ func (t * Type ) AsObjectType () * ObjectType { return t .data () .AsObjectType () }
599
+ func (t * Type ) AsTypeReference () * TypeReference { return t .data () .AsTypeReference () }
600
+ func (t * Type ) AsInterfaceType () * InterfaceType { return t .data () .AsInterfaceType () }
613
601
func (t * Type ) AsUnionOrIntersectionType () * UnionOrIntersectionType {
614
- return t .data .AsUnionOrIntersectionType ()
602
+ return t .data () .AsUnionOrIntersectionType ()
615
603
}
616
604
617
605
func (t * Type ) Distributed () []* Type {
@@ -672,7 +660,7 @@ func (t *Type) TargetTupleType() *TupleType {
672
660
673
661
// TypeData
674
662
675
- type TypeData interface {
663
+ type typeData interface {
676
664
AsType () * Type
677
665
AsConstrainedType () * ConstrainedType
678
666
AsStructuredType () * StructuredType
0 commit comments