2014-07-13 01:04:16 +02:00
|
|
|
//// [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]
|
2014-08-19 19:43:13 +02:00
|
|
|
// duplicate property names are an error in all types
|
2014-07-13 01:04:16 +02:00
|
|
|
var C = (function () {
|
|
|
|
function C() {
|
|
|
|
this.baz = function () {
|
|
|
|
};
|
|
|
|
this.baz = function () {
|
|
|
|
};
|
|
|
|
}
|
|
|
|
C.prototype.bar = function (x) {
|
|
|
|
};
|
|
|
|
C.prototype.bar = function (x) {
|
|
|
|
};
|
|
|
|
return C;
|
|
|
|
})();
|
|
|
|
var a;
|
|
|
|
var b = {
|
|
|
|
foo: '',
|
|
|
|
foo: '',
|
|
|
|
bar: function () {
|
|
|
|
},
|
|
|
|
bar: function () {
|
|
|
|
}
|
|
|
|
};
|