@@ -528,41 +528,41 @@ type Type struct {
528
528
symbol * ast.Symbol
529
529
alias * TypeAlias
530
530
checker * Checker
531
- data TypeData // Type specific data
531
+ typeDataField
532
532
}
533
533
534
534
// Casts for concrete struct types
535
535
536
- func (t * Type ) AsIntrinsicType () * IntrinsicType { return t .data .(* IntrinsicType ) }
537
- func (t * Type ) AsLiteralType () * LiteralType { return t .data .(* LiteralType ) }
538
- func (t * Type ) AsUniqueESSymbolType () * UniqueESSymbolType { return t .data .(* UniqueESSymbolType ) }
539
- func (t * Type ) AsTupleType () * TupleType { return t .data .(* TupleType ) }
540
- func (t * Type ) AsSingleSignatureType () * SingleSignatureType { return t .data .(* SingleSignatureType ) }
536
+ func (t * Type ) AsIntrinsicType () * IntrinsicType { return t .data () .(* IntrinsicType ) }
537
+ func (t * Type ) AsLiteralType () * LiteralType { return t .data () .(* LiteralType ) }
538
+ func (t * Type ) AsUniqueESSymbolType () * UniqueESSymbolType { return t .data () .(* UniqueESSymbolType ) }
539
+ func (t * Type ) AsTupleType () * TupleType { return t .data () .(* TupleType ) }
540
+ func (t * Type ) AsSingleSignatureType () * SingleSignatureType { return t .data () .(* SingleSignatureType ) }
541
541
func (t * Type ) AsInstantiationExpressionType () * InstantiationExpressionType {
542
- return t .data .(* InstantiationExpressionType )
543
- }
544
- func (t * Type ) AsMappedType () * MappedType { return t .data .(* MappedType ) }
545
- func (t * Type ) AsReverseMappedType () * ReverseMappedType { return t .data .(* ReverseMappedType ) }
546
- func (t * Type ) AsEvolvingArrayType () * EvolvingArrayType { return t .data .(* EvolvingArrayType ) }
547
- func (t * Type ) AsTypeParameter () * TypeParameter { return t .data .(* TypeParameter ) }
548
- func (t * Type ) AsUnionType () * UnionType { return t .data .(* UnionType ) }
549
- func (t * Type ) AsIntersectionType () * IntersectionType { return t .data .(* IntersectionType ) }
550
- func (t * Type ) AsIndexType () * IndexType { return t .data .(* IndexType ) }
551
- func (t * Type ) AsIndexedAccessType () * IndexedAccessType { return t .data .(* IndexedAccessType ) }
552
- func (t * Type ) AsTemplateLiteralType () * TemplateLiteralType { return t .data .(* TemplateLiteralType ) }
553
- func (t * Type ) AsStringMappingType () * StringMappingType { return t .data .(* StringMappingType ) }
554
- func (t * Type ) AsSubstitutionType () * SubstitutionType { return t .data .(* SubstitutionType ) }
555
- func (t * Type ) AsConditionalType () * ConditionalType { return t .data .(* ConditionalType ) }
542
+ return t .data () .(* InstantiationExpressionType )
543
+ }
544
+ func (t * Type ) AsMappedType () * MappedType { return t .data () .(* MappedType ) }
545
+ func (t * Type ) AsReverseMappedType () * ReverseMappedType { return t .data () .(* ReverseMappedType ) }
546
+ func (t * Type ) AsEvolvingArrayType () * EvolvingArrayType { return t .data () .(* EvolvingArrayType ) }
547
+ func (t * Type ) AsTypeParameter () * TypeParameter { return t .data () .(* TypeParameter ) }
548
+ func (t * Type ) AsUnionType () * UnionType { return t .data () .(* UnionType ) }
549
+ func (t * Type ) AsIntersectionType () * IntersectionType { return t .data () .(* IntersectionType ) }
550
+ func (t * Type ) AsIndexType () * IndexType { return t .data () .(* IndexType ) }
551
+ func (t * Type ) AsIndexedAccessType () * IndexedAccessType { return t .data () .(* IndexedAccessType ) }
552
+ func (t * Type ) AsTemplateLiteralType () * TemplateLiteralType { return t .data () .(* TemplateLiteralType ) }
553
+ func (t * Type ) AsStringMappingType () * StringMappingType { return t .data () .(* StringMappingType ) }
554
+ func (t * Type ) AsSubstitutionType () * SubstitutionType { return t .data () .(* SubstitutionType ) }
555
+ func (t * Type ) AsConditionalType () * ConditionalType { return t .data () .(* ConditionalType ) }
556
556
557
557
// Casts for embedded struct types
558
558
559
- func (t * Type ) AsConstrainedType () * ConstrainedType { return t .data .AsConstrainedType () }
560
- func (t * Type ) AsStructuredType () * StructuredType { return t .data .AsStructuredType () }
561
- func (t * Type ) AsObjectType () * ObjectType { return t .data .AsObjectType () }
562
- func (t * Type ) AsTypeReference () * TypeReference { return t .data .AsTypeReference () }
563
- func (t * Type ) AsInterfaceType () * InterfaceType { return t .data .AsInterfaceType () }
559
+ func (t * Type ) AsConstrainedType () * ConstrainedType { return t .data () .AsConstrainedType () }
560
+ func (t * Type ) AsStructuredType () * StructuredType { return t .data () .AsStructuredType () }
561
+ func (t * Type ) AsObjectType () * ObjectType { return t .data () .AsObjectType () }
562
+ func (t * Type ) AsTypeReference () * TypeReference { return t .data () .AsTypeReference () }
563
+ func (t * Type ) AsInterfaceType () * InterfaceType { return t .data () .AsInterfaceType () }
564
564
func (t * Type ) AsUnionOrIntersectionType () * UnionOrIntersectionType {
565
- return t .data .AsUnionOrIntersectionType ()
565
+ return t .data () .AsUnionOrIntersectionType ()
566
566
}
567
567
568
568
func (t * Type ) Distributed () []* Type {
@@ -623,7 +623,7 @@ func (t *Type) TargetTupleType() *TupleType {
623
623
624
624
// TypeData
625
625
626
- type TypeData interface {
626
+ type typeData interface {
627
627
AsType () * Type
628
628
AsConstrainedType () * ConstrainedType
629
629
AsStructuredType () * StructuredType
0 commit comments