2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/memberOverride.ts(5,5): error TS2300: Duplicate identifier 'a'.
|
|
|
|
tests/cases/compiler/memberOverride.ts(8,5): error TS2323: Type 'string' is not assignable to type 'number'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== 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
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2300: Duplicate identifier 'a'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var n: number = x.a;
|
2014-07-19 02:30:06 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2323: Type 'string' is not assignable to type 'number'.
|