mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 11:13:43 +03:00
21 lines
340 B
TypeScript
21 lines
340 B
TypeScript
class C {
|
|
y: string;
|
|
constructor(private x: string, protected z: string) { }
|
|
}
|
|
|
|
var c: C;
|
|
var r = c.y;
|
|
var r2 = c.x; // error
|
|
var r3 = c.z; // error
|
|
|
|
class D<T> {
|
|
y: T;
|
|
constructor(a: T, private x: T, protected z: T) { }
|
|
}
|
|
|
|
var d: D<string>;
|
|
var r = d.y;
|
|
var r2 = d.x; // error
|
|
var r3 = d.a; // error
|
|
var r4 = d.z; // error
|