forked from moredevs-srl/TypeScript4ExtJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed inconsistent type compatibility for a type with a call signatur…
…e and and index signature (microsoft#23226)
- Loading branch information
1 parent
4170f35
commit 1d7723a
Showing
5 changed files
with
64 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
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/stringIndexerAndCallSignature.js
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,12 @@ | ||
//// [stringIndexerAndCallSignature.ts] | ||
type I = { | ||
(): string; | ||
[name: string]: number; | ||
} | ||
|
||
declare let val: { (): string } & { foo: number; } | ||
let a: I = val; | ||
|
||
|
||
//// [stringIndexerAndCallSignature.js] | ||
var a = val; |
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/stringIndexerAndCallSignature.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,18 @@ | ||
=== tests/cases/compiler/stringIndexerAndCallSignature.ts === | ||
type I = { | ||
>I : Symbol(I, Decl(stringIndexerAndCallSignature.ts, 0, 0)) | ||
|
||
(): string; | ||
[name: string]: number; | ||
>name : Symbol(name, Decl(stringIndexerAndCallSignature.ts, 2, 5)) | ||
} | ||
|
||
declare let val: { (): string } & { foo: number; } | ||
>val : Symbol(val, Decl(stringIndexerAndCallSignature.ts, 5, 11)) | ||
>foo : Symbol(foo, Decl(stringIndexerAndCallSignature.ts, 5, 35)) | ||
|
||
let a: I = val; | ||
>a : Symbol(a, Decl(stringIndexerAndCallSignature.ts, 6, 3)) | ||
>I : Symbol(I, Decl(stringIndexerAndCallSignature.ts, 0, 0)) | ||
>val : Symbol(val, Decl(stringIndexerAndCallSignature.ts, 5, 11)) | ||
|
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/stringIndexerAndCallSignature.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/stringIndexerAndCallSignature.ts === | ||
type I = { | ||
>I : I | ||
|
||
(): string; | ||
[name: string]: number; | ||
>name : string | ||
} | ||
|
||
declare let val: { (): string } & { foo: number; } | ||
>val : (() => string) & { foo: number; } | ||
>foo : number | ||
|
||
let a: I = val; | ||
>a : I | ||
>I : I | ||
>val : (() => string) & { foo: number; } | ||
|
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 @@ | ||
type I = { | ||
(): string; | ||
[name: string]: number; | ||
} | ||
|
||
declare let val: { (): string } & { foo: number; } | ||
let a: I = val; |