|
1 | 1 | //// [tests/cases/compiler/defaultValueInFunctionTypes.ts] ////
|
2 | 2 |
|
3 | 3 | === defaultValueInFunctionTypes.ts ===
|
| 4 | +type Foo = ({ first = 0 }: { first?: number }) => unknown; |
| 5 | +>Foo : Symbol(Foo, Decl(defaultValueInFunctionTypes.ts, 0, 0)) |
| 6 | +>first : Symbol(first, Decl(defaultValueInFunctionTypes.ts, 0, 13)) |
| 7 | +>first : Symbol(first, Decl(defaultValueInFunctionTypes.ts, 0, 28)) |
| 8 | + |
4 | 9 | var x: (a: number = 1) => number;
|
5 |
| ->x : Symbol(x, Decl(defaultValueInFunctionTypes.ts, 0, 3)) |
6 |
| ->a : Symbol(a, Decl(defaultValueInFunctionTypes.ts, 0, 8)) |
| 10 | +>x : Symbol(x, Decl(defaultValueInFunctionTypes.ts, 2, 3)) |
| 11 | +>a : Symbol(a, Decl(defaultValueInFunctionTypes.ts, 2, 8)) |
7 | 12 |
|
8 | 13 | var y = <(a : string = "") => any>(undefined)
|
9 |
| ->y : Symbol(y, Decl(defaultValueInFunctionTypes.ts, 1, 3)) |
10 |
| ->a : Symbol(a, Decl(defaultValueInFunctionTypes.ts, 1, 10)) |
| 14 | +>y : Symbol(y, Decl(defaultValueInFunctionTypes.ts, 3, 3)) |
| 15 | +>a : Symbol(a, Decl(defaultValueInFunctionTypes.ts, 3, 10)) |
11 | 16 | >undefined : Symbol(undefined)
|
12 | 17 |
|
0 commit comments