Files
tsgo/testdata/baselines/reference/submodule/conformance/duplicatePropertyNames.js

71 lines
1000 B
TypeScript

//// [tests/cases/conformance/types/members/duplicatePropertyNames.ts] ////
//// [duplicatePropertyNames.ts]
// duplicate property names are an error in all types
interface Number {
foo: string;
foo: string;
}
interface String {
foo(): string;
foo(): string;
}
interface Array<T> {
foo: T;
foo: T;
}
class C {
foo: string;
foo: string;
bar(x) { }
bar(x) { }
baz = () => { }
baz = () => { }
}
interface I {
foo: string;
foo: string;
}
var a: {
foo: string;
foo: string;
bar: () => {};
bar: () => {};
}
var b = {
foo: '',
foo: '',
bar: () => { },
bar: () => { }
}
//// [duplicatePropertyNames.js]
"use strict";
// duplicate property names are an error in all types
class C {
constructor() {
this.baz = () => { };
this.baz = () => { };
}
bar(x) { }
bar(x) { }
}
var a;
var b = {
foo: '',
foo: '',
bar: () => { },
bar: () => { }
};