106 lines
4.7 KiB
Text
106 lines
4.7 KiB
Text
|
==== tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts (4 errors) ====
|
||
|
|
||
|
export module publicModule {
|
||
|
export class publicClassInPublicModule {
|
||
|
private f1() {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class privateClassInPublicModule {
|
||
|
}
|
||
|
|
||
|
class privateClassExtendingPublicClassInModule extends publicClassInPublicModule {
|
||
|
}
|
||
|
class privateClassExtendingPrivateClassInModule extends privateClassInPublicModule {
|
||
|
}
|
||
|
export class publicClassExtendingPublicClassInModule extends publicClassInPublicModule {
|
||
|
}
|
||
|
export class publicClassExtendingPrivateClassInModule extends privateClassInPublicModule { // Should error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Extends clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'.
|
||
|
}
|
||
|
|
||
|
class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule {
|
||
|
}
|
||
|
export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'.
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module privateModule {
|
||
|
export class publicClassInPrivateModule {
|
||
|
private f1() {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class privateClassInPrivateModule {
|
||
|
}
|
||
|
|
||
|
class privateClassExtendingPublicClassInModule extends publicClassInPrivateModule {
|
||
|
}
|
||
|
class privateClassExtendingPrivateClassInModule extends privateClassInPrivateModule {
|
||
|
}
|
||
|
export class publicClassExtendingPublicClassInModule extends publicClassInPrivateModule {
|
||
|
}
|
||
|
export class publicClassExtendingPrivateClassInModule extends privateClassInPrivateModule {
|
||
|
}
|
||
|
|
||
|
class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule {
|
||
|
}
|
||
|
export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export class publicClass {
|
||
|
private f1() {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class privateClass {
|
||
|
}
|
||
|
|
||
|
class privateClassExtendingPublicClass extends publicClass {
|
||
|
}
|
||
|
class privateClassExtendingPrivateClassInModule extends privateClass {
|
||
|
}
|
||
|
export class publicClassExtendingPublicClass extends publicClass {
|
||
|
}
|
||
|
export class publicClassExtendingPrivateClass extends privateClass { // Should error
|
||
|
~~~~~~~~~~~~
|
||
|
!!! Extends clause of exported class 'publicClassExtendingPrivateClass' has or is using private name 'privateClass'.
|
||
|
}
|
||
|
|
||
|
class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule {
|
||
|
}
|
||
|
export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Extends clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using name 'privateModule.publicClassInPrivateModule' from private module 'privateModule'.
|
||
|
}
|
||
|
|
||
|
==== tests/cases/compiler/privacyClassExtendsClauseDeclFile_GlobalFile.ts (1 errors) ====
|
||
|
module publicModuleInGlobal {
|
||
|
export class publicClassInPublicModule {
|
||
|
private f1() {
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class privateClassInPublicModule {
|
||
|
}
|
||
|
|
||
|
class privateClassExtendingPublicClassInModule extends publicClassInPublicModule {
|
||
|
}
|
||
|
class privateClassExtendingPrivateClassInModule extends privateClassInPublicModule {
|
||
|
}
|
||
|
export class publicClassExtendingPublicClassInModule extends publicClassInPublicModule {
|
||
|
}
|
||
|
export class publicClassExtendingPrivateClassInModule extends privateClassInPublicModule { // Should error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Extends clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'.
|
||
|
}
|
||
|
}
|
||
|
class publicClassInGlobal {
|
||
|
}
|
||
|
class publicClassExtendingPublicClassInGlobal extends publicClassInGlobal {
|
||
|
}
|
||
|
|