mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Add regression test
This commit is contained in:
parent
6909574973
commit
68ab129fac
15
tests/baselines/reference/limitDeepInstantiations.errors.txt
Normal file
15
tests/baselines/reference/limitDeepInstantiations.errors.txt
Normal file
@ -0,0 +1,15 @@
|
||||
tests/cases/compiler/limitDeepInstantiations.ts(3,35): error TS2550: Generic type instantiation is excessively deep and possibly infinite.
|
||||
tests/cases/compiler/limitDeepInstantiations.ts(5,13): error TS2344: Type '"false"' does not satisfy the constraint '"true"'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/limitDeepInstantiations.ts (2 errors) ====
|
||||
// Repro from #14837
|
||||
|
||||
type Foo<T extends "true", B> = { "true": Foo<T, Foo<T, B>> }[T];
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2550: Generic type instantiation is excessively deep and possibly infinite.
|
||||
let f1: Foo<"true", {}>;
|
||||
let f2: Foo<"false", {}>;
|
||||
~~~~~~~
|
||||
!!! error TS2344: Type '"false"' does not satisfy the constraint '"true"'.
|
||||
|
||||
12
tests/baselines/reference/limitDeepInstantiations.js
Normal file
12
tests/baselines/reference/limitDeepInstantiations.js
Normal file
@ -0,0 +1,12 @@
|
||||
//// [limitDeepInstantiations.ts]
|
||||
// Repro from #14837
|
||||
|
||||
type Foo<T extends "true", B> = { "true": Foo<T, Foo<T, B>> }[T];
|
||||
let f1: Foo<"true", {}>;
|
||||
let f2: Foo<"false", {}>;
|
||||
|
||||
|
||||
//// [limitDeepInstantiations.js]
|
||||
// Repro from #14837
|
||||
var f1;
|
||||
var f2;
|
||||
5
tests/cases/compiler/limitDeepInstantiations.ts
Normal file
5
tests/cases/compiler/limitDeepInstantiations.ts
Normal file
@ -0,0 +1,5 @@
|
||||
// Repro from #14837
|
||||
|
||||
type Foo<T extends "true", B> = { "true": Foo<T, Foo<T, B>> }[T];
|
||||
let f1: Foo<"true", {}>;
|
||||
let f2: Foo<"false", {}>;
|
||||
Loading…
x
Reference in New Issue
Block a user