TypeScript/tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt
Daniel Rosenwasser 6e77e2e810 Removed colons from diagnostic messages.
Also got rid of the 'terminalMessages' concept.
2014-10-28 00:48:58 -07:00

22 lines
No EOL
990 B
Text

tests/cases/compiler/propertyParameterWithQuestionMark.ts(6,5): error TS2323: Type '{}' is not assignable to type 'C'.
Property 'x' is missing in type '{}'.
tests/cases/compiler/propertyParameterWithQuestionMark.ts(8,1): error TS2323: Type '{ x?: any; }' is not assignable to type 'C'.
Property 'x' is optional in type '{ x?: any; }' but required in type 'C'.
==== tests/cases/compiler/propertyParameterWithQuestionMark.ts (2 errors) ====
class C {
constructor(public x?) { }
}
// x should not be an optional property
var v: C = {}; // Should fail
~
!!! error TS2323: Type '{}' is not assignable to type 'C'.
!!! error TS2323: Property 'x' is missing in type '{}'.
var v2: { x? }
v = v2; // Should fail
~
!!! error TS2323: Type '{ x?: any; }' is not assignable to type 'C'.
!!! error TS2323: Property 'x' is optional in type '{ x?: any; }' but required in type 'C'.
var v3: { x } = new C; // Should succeed