Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions internal/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -17879,6 +17879,7 @@ func (c *Checker) pushTypeResolution(target TypeSystemEntity, propertyName TypeS
func (c *Checker) popTypeResolution() bool {
lastIndex := len(c.typeResolutions) - 1
result := c.typeResolutions[lastIndex].result
c.typeResolutions[lastIndex] = TypeResolution{} // Clear the last entry to avoid memory leaks
c.typeResolutions = c.typeResolutions[:lastIndex]
return result
}
Expand Down Expand Up @@ -29354,7 +29355,9 @@ func (c *Checker) pushContextualType(node *ast.Node, t *Type, isCache bool) {
}

func (c *Checker) popContextualType() {
c.contextualInfos = c.contextualInfos[:len(c.contextualInfos)-1]
lastIndex := len(c.contextualInfos) - 1
c.contextualInfos[lastIndex] = ContextualInfo{}
c.contextualInfos = c.contextualInfos[:lastIndex]
Comment on lines +29358 to +29360
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is honestly better written slices.Delete, which also nils things out, but, whatever

}

func (c *Checker) findContextualNode(node *ast.Node, includeCaches bool) int {
Expand Down Expand Up @@ -29424,7 +29427,9 @@ func (c *Checker) pushInferenceContext(node *ast.Node, context *InferenceContext
}

func (c *Checker) popInferenceContext() {
c.inferenceContextInfos = c.inferenceContextInfos[:len(c.inferenceContextInfos)-1]
lastIndex := len(c.inferenceContextInfos) - 1
c.inferenceContextInfos[lastIndex] = InferenceContextInfo{}
c.inferenceContextInfos = c.inferenceContextInfos[:lastIndex]
}

func (c *Checker) getInferenceContext(node *ast.Node) *InferenceContext {
Expand Down