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