Skip to content

Commit 5a88d66

Browse files
committed
fix(checker): use TypeFlagsTypeVariable for consistency with getInferenceInfoForType
- Change from TypeFlagsTypeParameter to TypeFlagsTypeVariable to match the pattern used in getInferenceInfoForType function - This ensures consistency in type flag checking across inference-related functions - TypeFlagsTypeVariable includes both type parameters and indexed access types, which is more comprehensive - Updated comment to reflect the more accurate terminology 'type variable' instead of 'type parameter'
1 parent ac20851 commit 5a88d66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/checker/inference.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,9 +1631,9 @@ func (c *Checker) mergeInferences(target []*InferenceInfo, source []*InferenceIn
16311631
// 3. For each union member, checking if the indexed property type matches the source literal.
16321632
// 4. If a match is found, inferring that union member as a candidate for the type parameter.
16331633
func (c *Checker) inferFromLiteralToIndexedAccess(n *InferenceState, source *Type, target *IndexedAccessType) {
1634-
// Only proceed if the object type is a type parameter that we're inferring
1634+
// Only proceed if the object type is a type variable that we're inferring
16351635
objectType := target.objectType
1636-
if objectType.flags&TypeFlagsTypeParameter != 0 {
1636+
if objectType.flags&TypeFlagsTypeVariable != 0 {
16371637
// Get the inference info for the type parameter
16381638
inference := getInferenceInfoForType(n, objectType)
16391639
if inference == nil || inference.isFixed {

0 commit comments

Comments
 (0)