@@ -481,7 +481,7 @@ const (
481
481
IterationUseAsyncYieldStar = IterationUseAllowsSyncIterablesFlag | IterationUseAllowsAsyncIterablesFlag | IterationUseYieldStarFlag
482
482
IterationUseGeneratorReturnType = IterationUseAllowsSyncIterablesFlag
483
483
IterationUseAsyncGeneratorReturnType = IterationUseAllowsAsyncIterablesFlag
484
- IterationUseCacheFlags = IterationUseAllowsSyncIterablesFlag | IterationUseAllowsAsyncIterablesFlag | IterationUseForOfFlag | IterationUseReportError
484
+ IterationUseCacheFlags = IterationUseAllowsSyncIterablesFlag | IterationUseAllowsAsyncIterablesFlag | IterationUseForOfFlag | IterationUseYieldStarFlag | IterationUseSpreadFlag | IterationUseDestructuringFlag | IterationUseReportError
485
485
)
486
486
487
487
type IterationTypes struct {
@@ -5748,9 +5748,7 @@ func (c *Checker) getIteratedTypeOrElementType(use IterationUse, inputType *Type
5748
5748
// downlevelIteration is requested.
5749
5749
if uplevelIteration || downlevelIteration || allowAsyncIterables {
5750
5750
// We only report errors for an invalid iterable type in ES2015 or higher.
5751
- fmt.Printf("DEBUG: getIteratedTypeOrElementType calling getIterationTypesOfIterable for use=%d\n", use)
5752
5751
iterationTypes := c.getIterationTypesOfIterable(inputType, use, core.IfElse(uplevelIteration, errorNode, nil))
5753
- fmt.Printf("DEBUG: getIterationTypesOfIterable returned yieldType=%v\n", iterationTypes.yieldType != nil)
5754
5752
if checkAssignability {
5755
5753
if iterationTypes.nextType != nil {
5756
5754
var diagnostic *diagnostics.Message
@@ -5771,7 +5769,6 @@ func (c *Checker) getIteratedTypeOrElementType(use IterationUse, inputType *Type
5771
5769
}
5772
5770
if iterationTypes.yieldType != nil || uplevelIteration {
5773
5771
if iterationTypes.yieldType == nil {
5774
- fmt.Printf("DEBUG: iterationTypes.yieldType is nil, returning nil\n")
5775
5772
return nil
5776
5773
}
5777
5774
if possibleOutOfBounds {
@@ -5903,13 +5900,10 @@ func (c *Checker) getIterationTypesOfIterable(t *Type, use IterationUse, errorNo
5903
5900
if IsTypeAny(t) {
5904
5901
return IterationTypes{c.anyType, c.anyType, c.anyType}
5905
5902
}
5906
- fmt.Printf("DEBUG: getIterationTypesOfIterable called with use=%d, errorNode=%v\n", use, errorNode != nil)
5907
5903
key := IterationTypesKey{typeId: t.id, use: use&IterationUseCacheFlags | core.IfElse(errorNode != nil, IterationUseReportError, 0)}
5908
5904
if cached, ok := c.iterationTypesCache[key]; ok {
5909
- fmt.Printf("DEBUG: getIterationTypesOfIterable cache hit\n")
5910
5905
return cached
5911
5906
}
5912
- fmt.Printf("DEBUG: getIterationTypesOfIterable cache miss\n")
5913
5907
result := c.getIterationTypesOfIterableWorker(t, use, errorNode)
5914
5908
c.iterationTypesCache[key] = result
5915
5909
return result
0 commit comments