Skip to content

Commit adb4738

Browse files
Merge pull request microsoft#28132 from a-tarasyuk/feature/28086
28086 - "--downlevelIteration errors should mention using later targets"
2 parents 4968989 + ba94fd9 commit adb4738

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26053,7 +26053,7 @@ namespace ts {
2605326053
? downlevelIteration
2605426054
? Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator
2605526055
: isIterable
26056-
? Diagnostics.Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators
26056+
? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators
2605726057
: Diagnostics.Type_0_is_not_an_array_type
2605826058
: downlevelIteration
2605926059
? Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator

src/compiler/diagnosticMessages.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,10 +2056,6 @@
20562056
"category": "Error",
20572057
"code": 2567
20582058
},
2059-
"Type '{0}' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators.": {
2060-
"category": "Error",
2061-
"code": 2568
2062-
},
20632059
"Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.": {
20642060
"category": "Error",
20652061
"code": 2569
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2568: Type 'Set<number>' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
1+
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2569: Type 'Set<number>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
22

33

44
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts (1 errors) ====
55
var union: string | Set<number>
66
for (const e of union) { }
77
~~~~~
8-
!!! error TS2568: Type 'Set<number>' is not an array type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
8+
!!! error TS2569: Type 'Set<number>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.

0 commit comments

Comments
 (0)