25 lines
No EOL
661 B
Text
25 lines
No EOL
661 B
Text
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties.ts (3 errors) ====
|
|
class C {
|
|
y: string;
|
|
constructor(private x: string) { }
|
|
}
|
|
|
|
var c: C;
|
|
var r = c.y;
|
|
var r2 = c.x; // error
|
|
~~~
|
|
!!! Property 'C.x' is inaccessible.
|
|
|
|
class D<T> {
|
|
y: T;
|
|
constructor(a: T, private x: T) { }
|
|
}
|
|
|
|
var d: D<string>;
|
|
var r = d.y;
|
|
var r2 = d.x; // error
|
|
~~~
|
|
!!! Property 'D.x' is inaccessible.
|
|
var r3 = d.a; // error
|
|
~
|
|
!!! Property 'a' does not exist on type 'D<string>'. |