123 lines
7.5 KiB
Text
123 lines
7.5 KiB
Text
|
==== tests/cases/compiler/privacyCannotNameVarTypeDeclFile_consumer.ts (12 errors) ====
|
||
|
import exporter = require("privacyCannotNameVarTypeDeclFile_exporter");
|
||
|
export class publicClassWithWithPrivatePropertyTypes {
|
||
|
static myPublicStaticProperty = exporter.createExportedWidget1(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Public static property 'myPublicStaticProperty' of exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyCannotNameVarTypeDeclFile_Widgets" but cannot be named.
|
||
|
private static myPrivateStaticProperty = exporter.createExportedWidget1();
|
||
|
myPublicProperty = exporter.createExportedWidget1(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Public property 'myPublicProperty' of exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyCannotNameVarTypeDeclFile_Widgets" but cannot be named.
|
||
|
private myPrivateProperty = exporter.createExportedWidget1();
|
||
|
|
||
|
static myPublicStaticProperty1 = exporter.createExportedWidget3(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Public static property 'myPublicStaticProperty1' of exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
|
||
|
private static myPrivateStaticProperty1 = exporter.createExportedWidget3();
|
||
|
myPublicProperty1 = exporter.createExportedWidget3(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Public property 'myPublicProperty1' of exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
|
||
|
private myPrivateProperty1 = exporter.createExportedWidget3();
|
||
|
}
|
||
|
|
||
|
class privateClassWithWithPrivatePropertyTypes {
|
||
|
static myPublicStaticProperty = exporter.createExportedWidget1();
|
||
|
private static myPrivateStaticProperty = exporter.createExportedWidget1();
|
||
|
myPublicProperty = exporter.createExportedWidget1();
|
||
|
private myPrivateProperty = exporter.createExportedWidget1();
|
||
|
|
||
|
static myPublicStaticProperty1 = exporter.createExportedWidget3();
|
||
|
private static myPrivateStaticProperty1 = exporter.createExportedWidget3();
|
||
|
myPublicProperty1 = exporter.createExportedWidget3();
|
||
|
private myPrivateProperty1 = exporter.createExportedWidget3();
|
||
|
}
|
||
|
|
||
|
export var publicVarWithPrivatePropertyTypes= exporter.createExportedWidget1(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Exported variable 'publicVarWithPrivatePropertyTypes' has or is using name 'Widget1' from external module "tests/cases/compiler/privacyCannotNameVarTypeDeclFile_Widgets" but cannot be named.
|
||
|
var privateVarWithPrivatePropertyTypes= exporter.createExportedWidget1();
|
||
|
export var publicVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Exported variable 'publicVarWithPrivatePropertyTypes1' has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
|
||
|
var privateVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3();
|
||
|
|
||
|
export class publicClassWithPrivateModulePropertyTypes {
|
||
|
static myPublicStaticProperty= exporter.createExportedWidget2(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Public static property 'myPublicStaticProperty' of exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyCannotNameVarTypeDeclFile_Widgets" but cannot be named.
|
||
|
myPublicProperty = exporter.createExportedWidget2(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Public property 'myPublicProperty' of exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyCannotNameVarTypeDeclFile_Widgets" but cannot be named.
|
||
|
static myPublicStaticProperty1 = exporter.createExportedWidget4(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Public static property 'myPublicStaticProperty1' of exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
|
||
|
myPublicProperty1 = exporter.createExportedWidget4(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Public property 'myPublicProperty1' of exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
|
||
|
}
|
||
|
export var publicVarWithPrivateModulePropertyTypes= exporter.createExportedWidget2(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyCannotNameVarTypeDeclFile_Widgets" but cannot be named.
|
||
|
export var publicVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4(); // Error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Exported variable 'publicVarWithPrivateModulePropertyTypes1' has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
|
||
|
|
||
|
class privateClassWithPrivateModulePropertyTypes {
|
||
|
static myPublicStaticProperty= exporter.createExportedWidget2();
|
||
|
myPublicProperty= exporter.createExportedWidget2();
|
||
|
static myPublicStaticProperty1 = exporter.createExportedWidget4();
|
||
|
myPublicProperty1 = exporter.createExportedWidget4();
|
||
|
}
|
||
|
var privateVarWithPrivateModulePropertyTypes= exporter.createExportedWidget2();
|
||
|
var privateVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4();
|
||
|
==== tests/cases/compiler/privacyCannotNameVarTypeDeclFile_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/privacyCannotNameVarTypeDeclFile_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/privacyCannotNameVarTypeDeclFile_exporter.ts (0 errors) ====
|
||
|
///<reference path='privacyCannotNameVarTypeDeclFile_GlobalWidgets.ts'/>
|
||
|
import Widgets = require("privacyCannotNameVarTypeDeclFile_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();
|
||
|
}
|
||
|
|