TypeScript/tests/baselines/reference/memberOverride.errors.txt
2014-09-11 16:11:08 -07:00

13 lines
471 B
Plaintext

==== tests/cases/compiler/memberOverride.ts (2 errors) ====
// An object initialiser accepts the first definition for the same property with a different type signature
// Should compile, since the second declaration of a overrides the first
var x = {
a: "",
a: 5
~
!!! error TS2300: Duplicate identifier 'a'.
}
var n: number = x.a;
~
!!! error TS2323: Type 'string' is not assignable to type 'number'.