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

Method pushTypeResolution

internal/checker/checker.go:18663–18674  ·  view source on GitHub ↗

** * Push an entry on the type resolution stack. If an entry with the given target and the given property name * is already on the stack, and no entries in between already have a type, then a circularity has occurred. * In this case, the result values of the existing entry and all entries pushed

(target TypeSystemEntity, propertyName TypeSystemPropertyName)

Source from the content-addressed store, hash-verified

18661 * @param propertyName The property name that should be used to query the target for its type
18662 */
18663func (c *Checker) pushTypeResolution(target TypeSystemEntity, propertyName TypeSystemPropertyName) bool {
18664 resolutionCycleStartIndex := c.findResolutionCycleStartIndex(target, propertyName)
18665 if resolutionCycleStartIndex >= 0 {
18666 // A cycle was found
18667 for i := resolutionCycleStartIndex; i < len(c.typeResolutions); i++ {
18668 c.typeResolutions[i].result = false
18669 }
18670 return false
18671 }
18672 c.typeResolutions = append(c.typeResolutions, TypeResolution{target: target, propertyName: propertyName, result: true})
18673 return true
18674}
18675
18676/**
18677 * Pop an entry from the type resolution stack and return its associated result value. The result value will

Calls 3

lenFunction · 0.85
appendFunction · 0.50

Tested by

no test coverage detected