diff --git a/tsc/testdata/baselines/reference/compiler/contextuallyTypedParametersWithInitializers2.symbols b/tsc/testdata/baselines/reference/compiler/contextuallyTypedParametersWithInitializers2.symbols index 53a8082c893bf..c1b322c2e0ec0 100644 --- a/tsc/testdata/baselines/reference/compiler/contextuallyTypedParametersWithInitializers2.symbols +++ b/tsc/testdata/baselines/reference/compiler/contextuallyTypedParametersWithInitializers2.symbols @@ -56,3 +56,19 @@ const test3: (arg: number) => void = (arg = 1) => {}; >arg : Symbol(arg, Decl(contextuallyTypedParametersWithInitializers2.ts, 18, 14)) >arg : Symbol(arg, Decl(contextuallyTypedParametersWithInitializers2.ts, 18, 38)) +const test4: (reader: () => number, value: 1) => void = +>test4 : Symbol(test4, Decl(contextuallyTypedParametersWithInitializers2.ts, 20, 5)) +>reader : Symbol(reader, Decl(contextuallyTypedParametersWithInitializers2.ts, 20, 14)) +>value : Symbol(value, Decl(contextuallyTypedParametersWithInitializers2.ts, 20, 35)) + + (get = () => x, x = 0) => { +>get : Symbol(get, Decl(contextuallyTypedParametersWithInitializers2.ts, 21, 3)) +>x : Symbol(x, Decl(contextuallyTypedParametersWithInitializers2.ts, 21, 17)) +>x : Symbol(x, Decl(contextuallyTypedParametersWithInitializers2.ts, 21, 17)) + + x.toFixed(); +>x.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(contextuallyTypedParametersWithInitializers2.ts, 21, 17)) +>toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) + + }; diff --git a/tsc/testdata/baselines/reference/compiler/contextuallyTypedParametersWithInitializers2.types b/tsc/testdata/baselines/reference/compiler/contextuallyTypedParametersWithInitializers2.types index 79855f1d25e3e..a2f7e2dfb5b78 100644 --- a/tsc/testdata/baselines/reference/compiler/contextuallyTypedParametersWithInitializers2.types +++ b/tsc/testdata/baselines/reference/compiler/contextuallyTypedParametersWithInitializers2.types @@ -61,3 +61,23 @@ const test3: (arg: number) => void = (arg = 1) => {}; >arg : number >1 : 1 +const test4: (reader: () => number, value: 1) => void = +>test4 : (reader: () => number, value: 1) => void +>reader : () => number +>value : 1 + + (get = () => x, x = 0) => { +>(get = () => x, x = 0) => { x.toFixed(); } : (get?: () => number, x?: number) => void +>get : () => number +>() => x : () => 1 +>x : number +>x : number +>0 : 0 + + x.toFixed(); +>x.toFixed() : string +>x.toFixed : (fractionDigits?: number) => string +>x : number +>toFixed : (fractionDigits?: number) => string + + }; diff --git a/tsc/testdata/tests/cases/compiler/contextuallyTypedParametersWithInitializers2.ts b/tsc/testdata/tests/cases/compiler/contextuallyTypedParametersWithInitializers2.ts index f07e313505981..4f1134f29bda4 100644 --- a/tsc/testdata/tests/cases/compiler/contextuallyTypedParametersWithInitializers2.ts +++ b/tsc/testdata/tests/cases/compiler/contextuallyTypedParametersWithInitializers2.ts @@ -21,3 +21,8 @@ declare const num: number; const test2: (arg: 1 | 2) => void = (arg = num) => {}; const test3: (arg: number) => void = (arg = 1) => {}; + +const test4: (reader: () => number, value: 1) => void = + (get = () => x, x = 0) => { + x.toFixed(); + }; \ No newline at end of file