(typ super.Type)
| 930 | } |
| 931 | |
| 932 | func hasString(typ super.Type) bool { |
| 933 | switch typ := super.TypeUnder(typ).(type) { |
| 934 | case *super.TypeError: |
| 935 | return isUnknown(typ) |
| 936 | case *super.TypeOfString, *super.TypeOfNull: |
| 937 | return true |
| 938 | case *super.TypeUnion: |
| 939 | return slices.ContainsFunc(typ.Types, hasString) |
| 940 | } |
| 941 | return false |
| 942 | } |
| 943 | |
| 944 | func isUnknown(typ super.Type) bool { |
| 945 | if err, ok := super.TypeUnder(typ).(*super.TypeError); ok { |