mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 06:41:59 -06:00
Add regression test
This commit is contained in:
parent
b457de4067
commit
5524a61ce9
15
tests/cases/compiler/unionReductionMutualSubtypes.ts
Normal file
15
tests/cases/compiler/unionReductionMutualSubtypes.ts
Normal file
@ -0,0 +1,15 @@
|
||||
// @strict: true
|
||||
|
||||
// Repro from #35414
|
||||
|
||||
interface ReturnVal {
|
||||
something(): void;
|
||||
}
|
||||
|
||||
const k: ReturnVal = { something() { } }
|
||||
|
||||
declare const val: ReturnVal;
|
||||
function run(options: { something?(b?: string): void }) {
|
||||
const something = options.something ?? val.something;
|
||||
something('');
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user