Skip to content

Commit 2a2ef28

Browse files
committed
Undo the change to return
1 parent 4dc9da2 commit 2a2ef28

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/es6.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ interface IteratorResult<T> {
443443

444444
interface Iterator<T> {
445445
next(value?: any): IteratorResult<T>;
446-
return?(value?: T): IteratorResult<T>;
446+
return?(value?: any): IteratorResult<T>;
447447
throw?(e?: any): IteratorResult<T>;
448448
}
449449

tests/baselines/reference/for-of30.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Ty
33
Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
44
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
55
Types of property 'return' are incompatible.
6-
Type 'number' is not assignable to type '(value?: string) => IteratorResult<string>'.
6+
Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
77

88

99
==== tests/cases/conformance/es6/for-ofStatements/for-of30.ts (1 errors) ====
@@ -14,7 +14,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Ty
1414
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
1515
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
1616
!!! error TS2322: Types of property 'return' are incompatible.
17-
!!! error TS2322: Type 'number' is not assignable to type '(value?: string) => IteratorResult<string>'.
17+
!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
1818

1919
class StringIterator {
2020
next() {

0 commit comments

Comments
 (0)