Given a union type for which getKeyPropertyName returned a non-empty string, return the constituent that corresponds to the given key type for that property name.
(t *Type, keyType *Type)
| 1129 | // Given a union type for which getKeyPropertyName returned a non-empty string, return the constituent |
| 1130 | // that corresponds to the given key type for that property name. |
| 1131 | func (c *Checker) getConstituentTypeForKeyType(t *Type, keyType *Type) *Type { |
| 1132 | result := t.AsUnionType().constituentMap[c.getRegularTypeOfLiteralType(keyType)] |
| 1133 | if result != c.unknownType { |
| 1134 | return result |
| 1135 | } |
| 1136 | return nil |
| 1137 | } |
| 1138 | |
| 1139 | func (c *Checker) computeKeyPropertyNameAndMap(t *Type) (string, map[*Type]*Type) { |
| 1140 | types := t.Types() |
no test coverage detected