|
| 1 | +tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts(2,13): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{}'. |
| 2 | +tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts(2,19): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{}'. |
| 3 | +tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts(3,23): error TS2353: Object literal may only specify known properties, and 'y4' does not exist in type '{ x4: any; }'. |
| 4 | +tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts(4,16): error TS2353: Object literal may only specify known properties, and 'x5' does not exist in type '{ y5: any; }'. |
| 5 | +tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts(6,27): error TS2353: Object literal may only specify known properties, and 'y7' does not exist in type '{ x7: any; }'. |
| 6 | +tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts(7,20): error TS2353: Object literal may only specify known properties, and 'x8' does not exist in type '{ y8: any; }'. |
| 7 | + |
| 8 | + |
| 9 | +==== tests/cases/compiler/declarationEmitDestructuringObjectLiteralPattern.ts (6 errors) ==== |
| 10 | + |
| 11 | + var { } = { x: 5, y: "hello" }; |
| 12 | + ~ |
| 13 | +!!! error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{}'. |
| 14 | + ~ |
| 15 | +!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{}'. |
| 16 | + var { x4 } = { x4: 5, y4: "hello" }; |
| 17 | + ~~ |
| 18 | +!!! error TS2353: Object literal may only specify known properties, and 'y4' does not exist in type '{ x4: any; }'. |
| 19 | + var { y5 } = { x5: 5, y5: "hello" }; |
| 20 | + ~~ |
| 21 | +!!! error TS2353: Object literal may only specify known properties, and 'x5' does not exist in type '{ y5: any; }'. |
| 22 | + var { x6, y6 } = { x6: 5, y6: "hello" }; |
| 23 | + var { x7: a1 } = { x7: 5, y7: "hello" }; |
| 24 | + ~~ |
| 25 | +!!! error TS2353: Object literal may only specify known properties, and 'y7' does not exist in type '{ x7: any; }'. |
| 26 | + var { y8: b1 } = { x8: 5, y8: "hello" }; |
| 27 | + ~~ |
| 28 | +!!! error TS2353: Object literal may only specify known properties, and 'x8' does not exist in type '{ y8: any; }'. |
| 29 | + var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; |
| 30 | + |
| 31 | + var { a: x11, b: { a: y11, b: { a: z11 }}} = { a: 1, b: { a: "hello", b: { a: true } } }; |
| 32 | + |
| 33 | + function f15() { |
| 34 | + var a4 = "hello"; |
| 35 | + var b4 = 1; |
| 36 | + var c4 = true; |
| 37 | + return { a4, b4, c4 }; |
| 38 | + } |
| 39 | + var { a4, b4, c4 } = f15(); |
| 40 | + |
| 41 | + module m { |
| 42 | + export var { a4, b4, c4 } = f15(); |
| 43 | + } |
0 commit comments