mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Add regression test
This commit is contained in:
12
tests/baselines/reference/mappedTypeInferenceCircularity.js
Normal file
12
tests/baselines/reference/mappedTypeInferenceCircularity.js
Normal file
@@ -0,0 +1,12 @@
|
||||
//// [mappedTypeInferenceCircularity.ts]
|
||||
// Repro from #12511
|
||||
|
||||
type HTML = { [K in 'div']: Block<HTML> };
|
||||
type Block<P> = <T>(func: HTML) => {};
|
||||
|
||||
declare var h: HTML;
|
||||
h.div(h);
|
||||
|
||||
//// [mappedTypeInferenceCircularity.js]
|
||||
// Repro from #12511
|
||||
h.div(h);
|
||||
@@ -0,0 +1,26 @@
|
||||
=== tests/cases/compiler/mappedTypeInferenceCircularity.ts ===
|
||||
// Repro from #12511
|
||||
|
||||
type HTML = { [K in 'div']: Block<HTML> };
|
||||
>HTML : Symbol(HTML, Decl(mappedTypeInferenceCircularity.ts, 0, 0))
|
||||
>K : Symbol(K, Decl(mappedTypeInferenceCircularity.ts, 2, 15))
|
||||
>Block : Symbol(Block, Decl(mappedTypeInferenceCircularity.ts, 2, 42))
|
||||
>HTML : Symbol(HTML, Decl(mappedTypeInferenceCircularity.ts, 0, 0))
|
||||
|
||||
type Block<P> = <T>(func: HTML) => {};
|
||||
>Block : Symbol(Block, Decl(mappedTypeInferenceCircularity.ts, 2, 42))
|
||||
>P : Symbol(P, Decl(mappedTypeInferenceCircularity.ts, 3, 11))
|
||||
>T : Symbol(T, Decl(mappedTypeInferenceCircularity.ts, 3, 17))
|
||||
>func : Symbol(func, Decl(mappedTypeInferenceCircularity.ts, 3, 20))
|
||||
>HTML : Symbol(HTML, Decl(mappedTypeInferenceCircularity.ts, 0, 0))
|
||||
|
||||
declare var h: HTML;
|
||||
>h : Symbol(h, Decl(mappedTypeInferenceCircularity.ts, 5, 11))
|
||||
>HTML : Symbol(HTML, Decl(mappedTypeInferenceCircularity.ts, 0, 0))
|
||||
|
||||
h.div(h);
|
||||
>h.div : Symbol(div)
|
||||
>h : Symbol(h, Decl(mappedTypeInferenceCircularity.ts, 5, 11))
|
||||
>div : Symbol(div)
|
||||
>h : Symbol(h, Decl(mappedTypeInferenceCircularity.ts, 5, 11))
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
=== tests/cases/compiler/mappedTypeInferenceCircularity.ts ===
|
||||
// Repro from #12511
|
||||
|
||||
type HTML = { [K in 'div']: Block<HTML> };
|
||||
>HTML : HTML
|
||||
>K : K
|
||||
>Block : Block<P>
|
||||
>HTML : HTML
|
||||
|
||||
type Block<P> = <T>(func: HTML) => {};
|
||||
>Block : Block<P>
|
||||
>P : P
|
||||
>T : T
|
||||
>func : HTML
|
||||
>HTML : HTML
|
||||
|
||||
declare var h: HTML;
|
||||
>h : HTML
|
||||
>HTML : HTML
|
||||
|
||||
h.div(h);
|
||||
>h.div(h) : {}
|
||||
>h.div : Block<HTML>
|
||||
>h : HTML
|
||||
>div : Block<HTML>
|
||||
>h : HTML
|
||||
|
||||
7
tests/cases/compiler/mappedTypeInferenceCircularity.ts
Normal file
7
tests/cases/compiler/mappedTypeInferenceCircularity.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
// Repro from #12511
|
||||
|
||||
type HTML = { [K in 'div']: Block<HTML> };
|
||||
type Block<P> = <T>(func: HTML) => {};
|
||||
|
||||
declare var h: HTML;
|
||||
h.div(h);
|
||||
Reference in New Issue
Block a user