13 lines
No EOL
443 B
Text
13 lines
No EOL
443 B
Text
==== 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
|
|
~
|
|
!!! Duplicate identifier 'a'.
|
|
}
|
|
|
|
var n: number = x.a;
|
|
~
|
|
!!! Type 'string' is not assignable to type 'number'. |