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
dacc851434
commit
57705fc4e0
18
tests/baselines/reference/circularContextualReturnType.js
Normal file
18
tests/baselines/reference/circularContextualReturnType.js
Normal file
@ -0,0 +1,18 @@
|
||||
//// [circularContextualReturnType.ts]
|
||||
// Repro from #17711
|
||||
|
||||
Object.freeze({
|
||||
foo() {
|
||||
return Object.freeze('a');
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
//// [circularContextualReturnType.js]
|
||||
"use strict";
|
||||
// Repro from #17711
|
||||
Object.freeze({
|
||||
foo: function () {
|
||||
return Object.freeze('a');
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,19 @@
|
||||
=== tests/cases/compiler/circularContextualReturnType.ts ===
|
||||
// Repro from #17711
|
||||
|
||||
Object.freeze({
|
||||
>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
foo() {
|
||||
>foo : Symbol(foo, Decl(circularContextualReturnType.ts, 2, 15))
|
||||
|
||||
return Object.freeze('a');
|
||||
>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
23
tests/baselines/reference/circularContextualReturnType.types
Normal file
23
tests/baselines/reference/circularContextualReturnType.types
Normal file
@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/circularContextualReturnType.ts ===
|
||||
// Repro from #17711
|
||||
|
||||
Object.freeze({
|
||||
>Object.freeze({ foo() { return Object.freeze('a'); },}) : Readonly<{ foo(): string; }>
|
||||
>Object.freeze : { <T>(a: T[]): ReadonlyArray<T>; <T extends Function>(f: T): T; <T>(o: T): Readonly<T>; }
|
||||
>Object : ObjectConstructor
|
||||
>freeze : { <T>(a: T[]): ReadonlyArray<T>; <T extends Function>(f: T): T; <T>(o: T): Readonly<T>; }
|
||||
>{ foo() { return Object.freeze('a'); },} : { foo(): string; }
|
||||
|
||||
foo() {
|
||||
>foo : () => string
|
||||
|
||||
return Object.freeze('a');
|
||||
>Object.freeze('a') : string
|
||||
>Object.freeze : { <T>(a: T[]): ReadonlyArray<T>; <T extends Function>(f: T): T; <T>(o: T): Readonly<T>; }
|
||||
>Object : ObjectConstructor
|
||||
>freeze : { <T>(a: T[]): ReadonlyArray<T>; <T extends Function>(f: T): T; <T>(o: T): Readonly<T>; }
|
||||
>'a' : "a"
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
9
tests/cases/compiler/circularContextualReturnType.ts
Normal file
9
tests/cases/compiler/circularContextualReturnType.ts
Normal file
@ -0,0 +1,9 @@
|
||||
// @strict: true
|
||||
|
||||
// Repro from #17711
|
||||
|
||||
Object.freeze({
|
||||
foo() {
|
||||
return Object.freeze('a');
|
||||
},
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user