mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
46 lines
2.1 KiB
Plaintext
46 lines
2.1 KiB
Plaintext
emitClassExpressionInDeclarationFile2.ts(1,12): error TS4094: Property 'p' of exported anonymous class type may not be private or protected.
|
|
emitClassExpressionInDeclarationFile2.ts(1,12): error TS4094: Property 'ps' of exported anonymous class type may not be private or protected.
|
|
emitClassExpressionInDeclarationFile2.ts(16,17): error TS4094: Property 'property' of exported anonymous class type may not be private or protected.
|
|
emitClassExpressionInDeclarationFile2.ts(23,14): error TS4094: Property 'property' of exported anonymous class type may not be private or protected.
|
|
|
|
|
|
==== emitClassExpressionInDeclarationFile2.ts (4 errors) ====
|
|
export var noPrivates = class {
|
|
~~~~~~~~~~
|
|
!!! error TS4094: Property 'p' of exported anonymous class type may not be private or protected.
|
|
!!! related TS9027 emitClassExpressionInDeclarationFile2.ts:1:12: Add a type annotation to the variable noPrivates.
|
|
~~~~~~~~~~
|
|
!!! error TS4094: Property 'ps' of exported anonymous class type may not be private or protected.
|
|
!!! related TS9027 emitClassExpressionInDeclarationFile2.ts:1:12: Add a type annotation to the variable noPrivates.
|
|
static getTags() { }
|
|
tags() { }
|
|
private static ps = -1
|
|
private p = 12
|
|
}
|
|
|
|
// altered repro from #15066 to add private property
|
|
export class FooItem {
|
|
foo(): void { }
|
|
name?: string;
|
|
private property = "capitalism"
|
|
}
|
|
|
|
export type Constructor<T> = new(...args: any[]) => T;
|
|
export function WithTags<T extends Constructor<FooItem>>(Base: T) {
|
|
~~~~~~~~
|
|
!!! error TS4094: Property 'property' of exported anonymous class type may not be private or protected.
|
|
return class extends Base {
|
|
static getTags(): void { }
|
|
tags(): void { }
|
|
}
|
|
}
|
|
|
|
export class Test extends WithTags(FooItem) {}
|
|
~~~~
|
|
!!! error TS4094: Property 'property' of exported anonymous class type may not be private or protected.
|
|
|
|
const test = new Test();
|
|
|
|
Test.getTags()
|
|
test.tags();
|
|
|