2014-07-13 01:04:16 +02:00
|
|
|
//// [constructorParameterProperties2.ts]
|
|
|
|
class C {
|
|
|
|
y: number;
|
|
|
|
constructor(y: number) { } // ok
|
|
|
|
}
|
|
|
|
|
|
|
|
var c: C;
|
|
|
|
var r = c.y;
|
|
|
|
|
|
|
|
class D {
|
|
|
|
y: number;
|
|
|
|
constructor(public y: number) { } // error
|
|
|
|
}
|
|
|
|
|
|
|
|
var d: D;
|
|
|
|
var r2 = d.y;
|
|
|
|
|
|
|
|
class E {
|
|
|
|
y: number;
|
|
|
|
constructor(private y: number) { } // error
|
|
|
|
}
|
|
|
|
|
|
|
|
var e: E;
|
|
|
|
var r3 = e.y; // error
|
|
|
|
|
|
|
|
//// [constructorParameterProperties2.js]
|
|
|
|
var C = (function () {
|
|
|
|
function C(y) {
|
2014-08-15 01:36:33 +02:00
|
|
|
} // ok
|
2014-07-13 01:04:16 +02:00
|
|
|
return C;
|
|
|
|
})();
|
|
|
|
var c;
|
|
|
|
var r = c.y;
|
|
|
|
var D = (function () {
|
|
|
|
function D(y) {
|
|
|
|
this.y = y;
|
2014-08-15 01:36:33 +02:00
|
|
|
} // error
|
2014-07-13 01:04:16 +02:00
|
|
|
return D;
|
|
|
|
})();
|
|
|
|
var d;
|
|
|
|
var r2 = d.y;
|
|
|
|
var E = (function () {
|
|
|
|
function E(y) {
|
|
|
|
this.y = y;
|
2014-08-15 01:36:33 +02:00
|
|
|
} // error
|
2014-07-13 01:04:16 +02:00
|
|
|
return E;
|
|
|
|
})();
|
|
|
|
var e;
|
2014-08-15 01:36:33 +02:00
|
|
|
var r3 = e.y; // error
|