36 lines
592 B
Text
36 lines
592 B
Text
=== tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility3.ts ===
|
|
class Base {
|
|
>Base : Base
|
|
|
|
constructor(protected p: number) { }
|
|
>p : number
|
|
}
|
|
|
|
class Derived extends Base {
|
|
>Derived : Derived
|
|
>Base : Base
|
|
|
|
constructor(public p: number) {
|
|
>p : number
|
|
|
|
super(p);
|
|
>super(p) : void
|
|
>super : typeof Base
|
|
>p : number
|
|
|
|
this.p; // OK
|
|
>this.p : number
|
|
>this : Derived
|
|
>p : number
|
|
}
|
|
}
|
|
|
|
var d: Derived;
|
|
>d : Derived
|
|
>Derived : Derived
|
|
|
|
d.p; // public, OK
|
|
>d.p : number
|
|
>d : Derived
|
|
>p : number
|
|
|