161 lines
No EOL
8.6 KiB
Text
161 lines
No EOL
8.6 KiB
Text
tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts(3,16): error TS4038: Return type of public static property getter from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets" but cannot be named.
|
|
tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts(9,9): error TS4041: Return type of public property getter from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets" but cannot be named.
|
|
tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts(15,16): error TS4038: Return type of public static property getter from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
|
|
tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts(21,9): error TS4041: Return type of public property getter from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
|
|
tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts(57,16): error TS4038: Return type of public static property getter from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets" but cannot be named.
|
|
tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts(60,9): error TS4041: Return type of public property getter from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets" but cannot be named.
|
|
tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts(63,16): error TS4038: Return type of public static property getter from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
|
|
tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts(66,9): error TS4041: Return type of public property getter from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
|
|
|
|
|
|
==== tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts (8 errors) ====
|
|
import exporter = require("privacyCannotNameAccessorDeclFile_exporter");
|
|
export class publicClassWithWithPrivateGetAccessorTypes {
|
|
static get myPublicStaticMethod() { // Error
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS4038: Return type of public static property getter from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets" but cannot be named.
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
private static get myPrivateStaticMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
get myPublicMethod() { // Error
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS4041: Return type of public property getter from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets" but cannot be named.
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
private get myPrivateMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
static get myPublicStaticMethod1() { // Error
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS4038: Return type of public static property getter from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
private static get myPrivateStaticMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
get myPublicMethod1() { // Error
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS4041: Return type of public property getter from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
private get myPrivateMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
}
|
|
|
|
class privateClassWithWithPrivateGetAccessorTypes {
|
|
static get myPublicStaticMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
private static get myPrivateStaticMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
get myPublicMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
private get myPrivateMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
static get myPublicStaticMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
private static get myPrivateStaticMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
get myPublicMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
private get myPrivateMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPrivateModuleGetAccessorTypes {
|
|
static get myPublicStaticMethod() { // Error
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS4038: Return type of public static property getter from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets" but cannot be named.
|
|
return exporter.createExportedWidget2();
|
|
}
|
|
get myPublicMethod() { // Error
|
|
~~~~~~~~~~~~~~
|
|
!!! error TS4041: Return type of public property getter from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets" but cannot be named.
|
|
return exporter.createExportedWidget2();
|
|
}
|
|
static get myPublicStaticMethod1() { // Error
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
!!! error TS4038: Return type of public static property getter from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
|
|
return exporter.createExportedWidget4();
|
|
}
|
|
get myPublicMethod1() { // Error
|
|
~~~~~~~~~~~~~~~
|
|
!!! error TS4041: Return type of public property getter from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
|
|
return exporter.createExportedWidget4();
|
|
}
|
|
}
|
|
|
|
class privateClassWithPrivateModuleGetAccessorTypes {
|
|
static get myPublicStaticMethod() {
|
|
return exporter.createExportedWidget2();
|
|
}
|
|
get myPublicMethod() {
|
|
return exporter.createExportedWidget2();
|
|
}
|
|
static get myPublicStaticMethod1() {
|
|
return exporter.createExportedWidget4();
|
|
}
|
|
get myPublicMethod1() {
|
|
return exporter.createExportedWidget4();
|
|
}
|
|
}
|
|
==== tests/cases/compiler/privacyCannotNameAccessorDeclFile_GlobalWidgets.ts (0 errors) ====
|
|
|
|
declare module "GlobalWidgets" {
|
|
export class Widget3 {
|
|
name: string;
|
|
}
|
|
export function createWidget3(): Widget3;
|
|
|
|
export module SpecializedGlobalWidget {
|
|
export class Widget4 {
|
|
name: string;
|
|
}
|
|
function createWidget4(): Widget4;
|
|
}
|
|
}
|
|
|
|
==== tests/cases/compiler/privacyCannotNameAccessorDeclFile_Widgets.ts (0 errors) ====
|
|
export class Widget1 {
|
|
name = 'one';
|
|
}
|
|
export function createWidget1() {
|
|
return new Widget1();
|
|
}
|
|
|
|
export module SpecializedWidget {
|
|
export class Widget2 {
|
|
name = 'one';
|
|
}
|
|
export function createWidget2() {
|
|
return new Widget2();
|
|
}
|
|
}
|
|
|
|
==== tests/cases/compiler/privacyCannotNameAccessorDeclFile_exporter.ts (0 errors) ====
|
|
///<reference path='privacyCannotNameAccessorDeclFile_GlobalWidgets.ts'/>
|
|
import Widgets = require("privacyCannotNameAccessorDeclFile_Widgets");
|
|
import Widgets1 = require("GlobalWidgets");
|
|
export function createExportedWidget1() {
|
|
return Widgets.createWidget1();
|
|
}
|
|
export function createExportedWidget2() {
|
|
return Widgets.SpecializedWidget.createWidget2();
|
|
}
|
|
export function createExportedWidget3() {
|
|
return Widgets1.createWidget3();
|
|
}
|
|
export function createExportedWidget4() {
|
|
return Widgets1.SpecializedGlobalWidget.createWidget4();
|
|
}
|
|
|