MCPcopy Create free account
hub / github.com/microsoft/typescript-go / addTypesToIntersection

Method addTypesToIntersection

internal/checker/checker.go:26145–26150  ·  view source on GitHub ↗

Add the given types to the given type set. Order is preserved, freshness is removed from literal types, duplicates are removed, and nested types of the given kind are flattened into the set.

(typeSet *orderedSet[*Type], includes TypeFlags, types []*Type)

Source from the content-addressed store, hash-verified

26143// Add the given types to the given type set. Order is preserved, freshness is removed from literal
26144// types, duplicates are removed, and nested types of the given kind are flattened into the set.
26145func (c *Checker) addTypesToIntersection(typeSet *orderedSet[*Type], includes TypeFlags, types []*Type) TypeFlags {
26146 for _, t := range types {
26147 includes = c.addTypeToIntersection(typeSet, includes, c.getRegularTypeOfLiteralType(t))
26148 }
26149 return includes
26150}
26151
26152func (c *Checker) addTypeToIntersection(typeSet *orderedSet[*Type], includes TypeFlags, t *Type) TypeFlags {
26153 flags := t.flags

Callers 2

getIntersectionTypeExMethod · 0.95
addTypeToIntersectionMethod · 0.95

Calls 2

addTypeToIntersectionMethod · 0.95

Tested by

no test coverage detected