mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
25 lines
765 B
TypeScript
25 lines
765 B
TypeScript
//// [tests/cases/conformance/classes/members/accessibility/protectedStaticNotAccessibleInClodule.ts] ////
|
|
|
|
//// [protectedStaticNotAccessibleInClodule.ts]
|
|
// Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error.
|
|
|
|
class C {
|
|
public static foo: string;
|
|
protected static bar: string;
|
|
}
|
|
|
|
namespace C {
|
|
export var f = C.foo; // OK
|
|
export var b = C.bar; // error
|
|
}
|
|
|
|
//// [protectedStaticNotAccessibleInClodule.js]
|
|
"use strict";
|
|
// Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error.
|
|
class C {
|
|
}
|
|
(function (C) {
|
|
C.f = C.foo; // OK
|
|
C.b = C.bar; // error
|
|
})(C || (C = {}));
|