mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
16 lines
450 B
TypeScript
16 lines
450 B
TypeScript
//// [tests/cases/compiler/circularOptionalityRemoval.ts] ////
|
|
|
|
//// [circularOptionalityRemoval.ts]
|
|
// Constructed repro
|
|
function fn1(x: number | undefined = x > 0 ? x : 0) { }
|
|
|
|
// Report from user
|
|
function fn2(x?: string = someCondition ? 'value1' : x) { }
|
|
|
|
//// [circularOptionalityRemoval.js]
|
|
"use strict";
|
|
// Constructed repro
|
|
function fn1(x = x > 0 ? x : 0) { }
|
|
// Report from user
|
|
function fn2(x = someCondition ? 'value1' : x) { }
|