2014-10-01 02:15:18 +02:00
|
|
|
tests/cases/compiler/memberOverride.ts(4,5): error TS2300: Duplicate identifier 'a'.
|
2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/memberOverride.ts(5,5): error TS2300: Duplicate identifier 'a'.
|
|
|
|
|
|
|
|
|
2015-01-07 00:17:07 +01:00
|
|
|
==== tests/cases/compiler/memberOverride.ts (2 errors) ====
|
2014-07-13 01:04:16 +02:00
|
|
|
// 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: "",
|
|
|
|
~
|
2014-10-01 02:15:18 +02:00
|
|
|
!!! error TS2300: Duplicate identifier 'a'.
|
|
|
|
a: 5
|
2014-10-01 20:27:20 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2300: Duplicate identifier 'a'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
2015-01-07 00:17:07 +01:00
|
|
|
var n: number = x.a;
|