-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't leak EvolvingArray out of code flow (#49943)
- Loading branch information
1 parent
3863cc4
commit 05d2076
Showing
6 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/evolvingArrayResolvedAssert.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
tests/cases/compiler/evolvingArrayResolvedAssert.ts(1,5): error TS7034: Variable 'C' implicitly has type 'any[]' in some locations where its type cannot be determined. | ||
tests/cases/compiler/evolvingArrayResolvedAssert.ts(2,15): error TS7005: Variable 'C' implicitly has an 'any[]' type. | ||
tests/cases/compiler/evolvingArrayResolvedAssert.ts(3,9): error TS7005: Variable 'C' implicitly has an 'any[]' type. | ||
|
||
|
||
==== tests/cases/compiler/evolvingArrayResolvedAssert.ts (3 errors) ==== | ||
var C = []; | ||
~ | ||
!!! error TS7034: Variable 'C' implicitly has type 'any[]' in some locations where its type cannot be determined. | ||
for (var a in C) { | ||
~ | ||
!!! error TS7005: Variable 'C' implicitly has an 'any[]' type. | ||
if (C.hasOwnProperty(a)) { | ||
~ | ||
!!! error TS7005: Variable 'C' implicitly has an 'any[]' type. | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//// [evolvingArrayResolvedAssert.ts] | ||
var C = []; | ||
for (var a in C) { | ||
if (C.hasOwnProperty(a)) { | ||
} | ||
} | ||
|
||
|
||
//// [evolvingArrayResolvedAssert.js] | ||
"use strict"; | ||
var C = []; | ||
for (var a in C) { | ||
if (C.hasOwnProperty(a)) { | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/evolvingArrayResolvedAssert.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== tests/cases/compiler/evolvingArrayResolvedAssert.ts === | ||
var C = []; | ||
>C : Symbol(C, Decl(evolvingArrayResolvedAssert.ts, 0, 3)) | ||
|
||
for (var a in C) { | ||
>a : Symbol(a, Decl(evolvingArrayResolvedAssert.ts, 1, 8)) | ||
>C : Symbol(C, Decl(evolvingArrayResolvedAssert.ts, 0, 3)) | ||
|
||
if (C.hasOwnProperty(a)) { | ||
>C.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.es5.d.ts, --, --)) | ||
>C : Symbol(C, Decl(evolvingArrayResolvedAssert.ts, 0, 3)) | ||
>hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.es5.d.ts, --, --)) | ||
>a : Symbol(a, Decl(evolvingArrayResolvedAssert.ts, 1, 8)) | ||
} | ||
} | ||
|
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/evolvingArrayResolvedAssert.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
=== tests/cases/compiler/evolvingArrayResolvedAssert.ts === | ||
var C = []; | ||
>C : any[] | ||
>[] : never[] | ||
|
||
for (var a in C) { | ||
>a : string | ||
>C : any[] | ||
|
||
if (C.hasOwnProperty(a)) { | ||
>C.hasOwnProperty(a) : boolean | ||
>C.hasOwnProperty : (v: PropertyKey) => boolean | ||
>C : any[] | ||
>hasOwnProperty : (v: PropertyKey) => boolean | ||
>a : string | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// @strict: true | ||
|
||
var C = []; | ||
for (var a in C) { | ||
if (C.hasOwnProperty(a)) { | ||
} | ||
} |