Merge branch 'master' into tupleTypes

Conflicts:
	tests/baselines/reference/typeName1.errors.txt
This commit is contained in:
Anders Hejlsberg
2014-08-16 11:11:59 -07:00
948 changed files with 28096 additions and 4975 deletions
@@ -0,0 +1,8 @@
==== tests/cases/compiler/aliasInaccessibleModule.ts (1 errors) ====
module M {
module N {
}
export import X = N;
~~~~~~~~~~~~~~~~~~~~
!!! Import declaration 'X' is using private name 'N'.
}
@@ -0,0 +1,12 @@
==== tests/cases/compiler/aliasInaccessibleModule2.ts (1 errors) ====
module M {
module N {
class C {
}
}
import R = N;
~~~~~~~~~~~~~
!!! Import declaration 'R' is using private name 'N'.
export import X = R;
}
@@ -1,30 +0,0 @@
==== tests/cases/compiler/aliasUsage1_main.ts (2 errors) ====
import Backbone = require("aliasUsage1_backbone");
import moduleA = require("aliasUsage1_moduleA");
interface IHasVisualizationModel {
VisualizationModel: typeof Backbone.Model;
}
class C2 {
x: IHasVisualizationModel;
get A() {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
return this.x;
}
set A(x) {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
x = moduleA;
}
}
==== tests/cases/compiler/aliasUsage1_backbone.ts (0 errors) ====
export class Model {
public someData: string;
}
==== tests/cases/compiler/aliasUsage1_moduleA.ts (0 errors) ====
import Backbone = require("aliasUsage1_backbone");
export class VisualizationModel extends Backbone.Model {
// interesting stuff here
}
@@ -0,0 +1,69 @@
//// [tests/cases/compiler/aliasUsageInAccessorsOfClass.ts] ////
//// [aliasUsage1_backbone.ts]
export class Model {
public someData: string;
}
//// [aliasUsage1_moduleA.ts]
import Backbone = require("aliasUsage1_backbone");
export class VisualizationModel extends Backbone.Model {
// interesting stuff here
}
//// [aliasUsage1_main.ts]
import Backbone = require("aliasUsage1_backbone");
import moduleA = require("aliasUsage1_moduleA");
interface IHasVisualizationModel {
VisualizationModel: typeof Backbone.Model;
}
class C2 {
x: IHasVisualizationModel;
get A() {
return this.x;
}
set A(x) {
x = moduleA;
}
}
//// [aliasUsage1_backbone.js]
var Model = (function () {
function Model() {
}
return Model;
})();
exports.Model = Model;
//// [aliasUsage1_moduleA.js]
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var Backbone = require("aliasUsage1_backbone");
var VisualizationModel = (function (_super) {
__extends(VisualizationModel, _super);
function VisualizationModel() {
_super.apply(this, arguments);
}
return VisualizationModel;
})(Backbone.Model);
exports.VisualizationModel = VisualizationModel;
//// [aliasUsage1_main.js]
var moduleA = require("aliasUsage1_moduleA");
var C2 = (function () {
function C2() {
}
Object.defineProperty(C2.prototype, "A", {
get: function () {
return this.x;
},
set: function (x) {
x = moduleA;
},
enumerable: true,
configurable: true
});
return C2;
})();
@@ -128,25 +128,25 @@
arr_any = f1; // should be an error - is
~~~~~~~
!!! Type '() => C1' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type '() => C1'.
!!! Property 'push' is missing in type '() => C1'.
arr_any = o1; // should be an error - is
~~~~~~~
!!! Type '{ one: number; }' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type '{ one: number; }'.
!!! Property 'length' is missing in type '{ one: number; }'.
arr_any = a1; // should be ok - is
arr_any = c1; // should be an error - is
~~~~~~~
!!! Type 'C1' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'C1'.
!!! Property 'length' is missing in type 'C1'.
arr_any = c2; // should be an error - is
~~~~~~~
!!! Type 'C2' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'C2'.
!!! Property 'length' is missing in type 'C2'.
arr_any = c3; // should be an error - is
~~~~~~~
!!! Type 'C3' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'C3'.
!!! Property 'length' is missing in type 'C3'.
arr_any = i1; // should be an error - is
~~~~~~~
!!! Type 'I1' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'I1'.
!!! Property 'length' is missing in type 'I1'.
@@ -64,30 +64,30 @@
arr_any = f1; // should be an error - is
~~~~~~~
!!! Type '() => C1' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type '() => C1'.
!!! Property 'push' is missing in type '() => C1'.
arr_any = function () { return null;} // should be an error - is
~~~~~~~
!!! Type '() => any' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type '() => any'.
!!! Property 'push' is missing in type '() => any'.
arr_any = o1; // should be an error - is
~~~~~~~
!!! Type '{ one: number; }' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type '{ one: number; }'.
!!! Property 'length' is missing in type '{ one: number; }'.
arr_any = a1; // should be ok - is
arr_any = c1; // should be an error - is
~~~~~~~
!!! Type 'C1' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'C1'.
!!! Property 'length' is missing in type 'C1'.
arr_any = c2; // should be an error - is
~~~~~~~
!!! Type 'C2' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'C2'.
!!! Property 'length' is missing in type 'C2'.
arr_any = c3; // should be an error - is
~~~~~~~
!!! Type 'C3' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'C3'.
!!! Property 'length' is missing in type 'C3'.
arr_any = i1; // should be an error - is
~~~~~~~
!!! Type 'I1' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'I1'.
!!! Property 'length' is missing in type 'I1'.
@@ -25,9 +25,9 @@
arr_any = function () { return null;} // should be an error - is
~~~~~~~
!!! Type '() => any' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type '() => any'.
!!! Property 'push' is missing in type '() => any'.
arr_any = c3; // should be an error - is
~~~~~~~
!!! Type 'C3' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'C3'.
!!! Property 'length' is missing in type 'C3'.
@@ -30,7 +30,7 @@
!!! Type 'number[][]' is not assignable to type 'number[][][]':
!!! Type 'number[]' is not assignable to type 'number[][]':
!!! Type 'number' is not assignable to type 'number[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
function isEmpty(l: { length: number }) {
return l.length === 0;
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: any[]; }':
!!! Types of property 'two' are incompatible:
!!! Type 'string' is not assignable to type 'any[]':
!!! Property 'join' is missing in type 'String'.
!!! Property 'push' is missing in type 'String'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'number[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
@@ -12,7 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: number[]; }':
!!! Types of property 'two' are incompatible:
!!! Type 'string' is not assignable to type 'number[]':
!!! Types of property 'concat' are incompatible:
!!! Type '(...strings: string[]) => string' is not assignable to type '{ <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }':
!!! Types of parameters 'strings' and 'items' are incompatible:
!!! Type 'string' is not assignable to type 'number'.
!!! Property 'push' is missing in type 'String'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'string[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: string[]; }':
!!! Types of property 'two' are incompatible:
!!! Type 'string' is not assignable to type 'string[]':
!!! Property 'join' is missing in type 'String'.
!!! Property 'push' is missing in type 'String'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'boolean[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
@@ -12,7 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ two: boolean[]; }':
!!! Types of property 'two' are incompatible:
!!! Type 'string' is not assignable to type 'boolean[]':
!!! Types of property 'concat' are incompatible:
!!! Type '(...strings: string[]) => string' is not assignable to type '{ <U extends boolean[]>(...items: U[]): boolean[]; (...items: boolean[]): boolean[]; }':
!!! Types of parameters 'strings' and 'items' are incompatible:
!!! Type 'string' is not assignable to type 'boolean'.
!!! Property 'push' is missing in type 'String'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: any[]; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'any[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: number[]; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'number[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: string[]; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'string[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
@@ -12,4 +12,4 @@
!!! Type 'interfaceWithPublicAndOptional<number, string>' is not assignable to type '{ one: boolean[]; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'boolean[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
@@ -487,11 +487,11 @@ declare var i1_ncf: (b: number) => number;
declare var i1_ncr: number;
declare var i1_ncprop: number;
declare var i1_s_p: number;
declare var i1_s_f: (b: number) => number;
declare var i1_s_f: typeof c1.s2;
declare var i1_s_r: number;
declare var i1_s_prop: number;
declare var i1_s_nc_p: number;
declare var i1_s_ncf: (b: number) => number;
declare var i1_s_ncf: typeof c1.nc_s2;
declare var i1_s_ncr: number;
declare var i1_s_ncprop: number;
declare var i1_c: typeof c1;
@@ -20,3 +20,24 @@ declare module "MainModule" {
//// [cyclicModuleImport.js]
//// [cyclicModuleImport.d.ts]
declare module "SubModule" {
import MainModule = require('MainModule');
class SubModule {
static StaticVar: number;
InstanceVar: number;
main: MainModule;
constructor();
}
export = SubModule;
}
declare module "MainModule" {
import SubModule = require('SubModule');
class MainModule {
SubModule: SubModule;
constructor();
}
export = MainModule;
}
@@ -27,28 +27,12 @@ exports.x;
declare module "SubModule" {
module m {
module m3 {
interface c {
}
}
}
}
//// [declFileAmbientExternalModuleWithSingleExportedModule_1.d.ts]
/// <reference path='declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts' />
import SubModule = require('SubModule');
export declare var x: SubModule.m.m3.c;
//// [DtsFileErrors]
==== tests/cases/compiler/declFileAmbientExternalModuleWithSingleExportedModule_1.d.ts (1 errors) ====
/// <reference path='declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts' />
export declare var x: SubModule.m.m3.c;
~~~~~~~~~~~~~~~~
!!! Cannot find name 'SubModule'.
==== tests/cases/compiler/declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts (0 errors) ====
declare module "SubModule" {
module m {
module m3 {
}
}
}
@@ -28,20 +28,5 @@ interface Foo<T> {
}
export = Foo;
//// [declFileExportAssignmentOfGenericInterface_1.d.ts]
import a = require('declFileExportAssignmentOfGenericInterface_0');
export declare var x: a<a<string>>;
//// [DtsFileErrors]
==== tests/cases/compiler/declFileExportAssignmentOfGenericInterface_1.d.ts (1 errors) ====
export declare var x: a<a<string>>;
~~~~~~~~~~~~
!!! Cannot find name 'a'.
==== tests/cases/compiler/declFileExportAssignmentOfGenericInterface_0.d.ts (0 errors) ====
interface Foo<T> {
a: string;
}
export = Foo;
@@ -74,33 +74,5 @@ export = b;
//// [declFileExportImportChain_c.d.ts]
export import b1 = require("declFileExportImportChain_b1");
//// [declFileExportImportChain_d.d.ts]
export declare var x: m1.m2.c1;
//// [DtsFileErrors]
==== tests/cases/compiler/declFileExportImportChain_d.d.ts (1 errors) ====
export declare var x: m1.m2.c1;
~~~~~~~~
!!! Cannot find name 'm1'.
==== tests/cases/compiler/declFileExportImportChain_a.d.ts (0 errors) ====
declare module m1 {
module m2 {
class c1 {
}
}
}
export = m1;
==== tests/cases/compiler/declFileExportImportChain_b.d.ts (0 errors) ====
export import a = require("declFileExportImportChain_a");
==== tests/cases/compiler/declFileExportImportChain_b1.d.ts (0 errors) ====
import b = require("declFileExportImportChain_b");
export = b;
==== tests/cases/compiler/declFileExportImportChain_c.d.ts (0 errors) ====
export import b1 = require("declFileExportImportChain_b1");
import c = require("declFileExportImportChain_c");
export declare var x: c.b1.a.m2.c1;
@@ -65,30 +65,5 @@ export = a;
//// [declFileExportImportChain2_c.d.ts]
export import b = require("declFileExportImportChain2_b");
//// [declFileExportImportChain2_d.d.ts]
export declare var x: m1.m2.c1;
//// [DtsFileErrors]
==== tests/cases/compiler/declFileExportImportChain2_d.d.ts (1 errors) ====
export declare var x: m1.m2.c1;
~~~~~~~~
!!! Cannot find name 'm1'.
==== tests/cases/compiler/declFileExportImportChain2_a.d.ts (0 errors) ====
declare module m1 {
module m2 {
class c1 {
}
}
}
export = m1;
==== tests/cases/compiler/declFileExportImportChain2_b.d.ts (0 errors) ====
import a = require("declFileExportImportChain2_a");
export = a;
==== tests/cases/compiler/declFileExportImportChain2_c.d.ts (0 errors) ====
export import b = require("declFileExportImportChain2_b");
import c = require("declFileExportImportChain2_c");
export declare var x: c.b.m2.c1;
@@ -131,10 +131,10 @@ export declare module C {
}
}
export declare var a: C.A<C.B>;
export declare var b: <T>(x: T) => C.A<C.B>;
export declare var c: <T>(x: T) => C.A<C.B>;
export declare var d: <T>(x: T) => C.A<C.B>[];
export declare var e: <T extends C.A<C.B>>(x: T) => C.A<C.B>[];
export declare var b: typeof C.F;
export declare var c: typeof C.F2;
export declare var d: typeof C.F3;
export declare var e: typeof C.F4;
export declare var x: C.A<C.B>;
export declare function f<T extends C.A<C.B>>(): void;
export declare var g: C.A<C.B>;
@@ -142,4 +142,4 @@ export declare class h extends C.A<C.B> {
}
export interface i extends C.A<C.B> {
}
export declare var j: <T extends C.A<C.B>>(x: T) => T;
export declare var j: typeof C.F6;
@@ -91,12 +91,21 @@ var templa;
//// [declFileGenericType2.d.ts]
declare module templa.mvc {
interface IModel {
}
}
declare module templa.mvc {
interface IController<ModelType extends IModel> {
}
}
declare module templa.mvc {
class AbstractController<ModelType extends IModel> implements IController<ModelType> {
}
}
declare module templa.mvc.composite {
interface ICompositeControllerModel extends IModel {
getControllers(): IController<IModel>[];
}
}
declare module templa.dom.mvc {
interface IElementController<ModelType extends templa.mvc.IModel> extends templa.mvc.IController<ModelType> {
@@ -113,45 +122,3 @@ declare module templa.dom.mvc.composite {
constructor();
}
}
//// [DtsFileErrors]
==== tests/cases/compiler/declFileGenericType2.d.ts (6 errors) ====
declare module templa.mvc {
}
declare module templa.mvc {
}
declare module templa.mvc {
}
declare module templa.mvc.composite {
}
declare module templa.dom.mvc {
interface IElementController<ModelType extends templa.mvc.IModel> extends templa.mvc.IController<ModelType> {
~~~~~~~~~~~~~~~~~
!!! Module 'templa.mvc' has no exported member 'IModel'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Module 'templa.mvc' has no exported member 'IController'.
}
}
declare module templa.dom.mvc {
class AbstractElementController<ModelType extends templa.mvc.IModel> extends templa.mvc.AbstractController<ModelType> implements IElementController<ModelType> {
~~~~~~~~~~~~~~~~~
!!! Module 'templa.mvc' has no exported member 'IModel'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Module 'templa.mvc' has no exported member 'AbstractController'.
constructor();
}
}
declare module templa.dom.mvc.composite {
class AbstractCompositeElementController<ModelType extends templa.mvc.composite.ICompositeControllerModel> extends AbstractElementController<ModelType> {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Module 'templa.mvc.composite' has no exported member 'ICompositeControllerModel'.
_controllers: templa.mvc.IController<templa.mvc.IModel>[];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Module 'templa.mvc' has no exported member 'IController'.
constructor();
}
}
@@ -0,0 +1,39 @@
//// [declFileImportChainInExportAssignment.ts]
module m {
export module c {
export class c {
}
}
}
import a = m.c;
import b = a;
export = b;
//// [declFileImportChainInExportAssignment.js]
var m;
(function (m) {
(function (_c) {
var c = (function () {
function c() {
}
return c;
})();
_c.c = c;
})(m.c || (m.c = {}));
var c = m.c;
})(m || (m = {}));
var a = m.c;
var b = a;
module.exports = b;
//// [declFileImportChainInExportAssignment.d.ts]
declare module m {
module c {
class c {
}
}
}
import a = m.c;
import b = a;
export = b;
@@ -52,43 +52,9 @@ declare var m2: {
};
export = m2;
//// [declFileImportModuleWithExportAssignment_1.d.ts]
import a1 = require("declFileImportModuleWithExportAssignment_0");
export declare var a: {
(): a1.connectExport;
test1: a1.connectModule;
test2(): a1.connectModule;
};
//// [DtsFileErrors]
==== tests/cases/compiler/declFileImportModuleWithExportAssignment_1.d.ts (3 errors) ====
export declare var a: {
(): a1.connectExport;
~~~~~~~~~~~~~~~~
!!! Cannot find name 'a1'.
test1: a1.connectModule;
~~~~~~~~~~~~~~~~
!!! Cannot find name 'a1'.
test2(): a1.connectModule;
~~~~~~~~~~~~~~~~
!!! Cannot find name 'a1'.
};
==== tests/cases/compiler/declFileImportModuleWithExportAssignment_0.d.ts (0 errors) ====
declare module m2 {
interface connectModule {
(res: any, req: any, next: any): void;
}
interface connectExport {
use: (mod: connectModule) => connectExport;
listen: (port: number) => void;
}
}
declare var m2: {
(): m2.connectExport;
test1: m2.connectModule;
test2(): m2.connectModule;
};
export = m2;
@@ -25,23 +25,10 @@ var List = (function () {
declare class List<T> {
}
declare module 'mod1' {
class Foo {
}
}
declare module 'moo' {
import x = require('mod1');
var p: List<x.Foo>;
}
//// [DtsFileErrors]
==== tests/cases/compiler/declFileImportedTypeUseInTypeArgPosition.d.ts (1 errors) ====
declare class List<T> {
}
declare module 'mod1' {
}
declare module 'moo' {
var p: List<x.Foo>;
~~~~~
!!! Cannot find name 'x'.
}
@@ -40,29 +40,10 @@ declare module m {
}
}
declare module m1 {
import x = m.c;
var d: x;
}
declare module m2 {
export import x = m.c;
var d: x;
}
//// [DtsFileErrors]
==== tests/cases/compiler/declFileInternalAliases.d.ts (1 errors) ====
declare module m {
class c {
}
}
declare module m1 {
var d: x;
~
!!! Cannot find name 'x'.
}
declare module m2 {
export import x = m.c;
var d: x;
}
@@ -64,39 +64,15 @@ function foo5(x) {
//// [declFileTypeofFunction.d.ts]
declare function f(n: {
(n: typeof f): string;
(n: {
(n: typeof g): number;
(n: typeof f): number;
}): string;
}): string;
declare function f(n: {
(n: typeof g): number;
(n: {
(n: typeof f): string;
(n: typeof g): string;
}): number;
}): string;
declare function g(n: {
(n: typeof g): number;
(n: {
(n: typeof f): string;
(n: typeof g): string;
}): number;
}): number;
declare function g(n: {
(n: typeof f): string;
(n: {
(n: typeof g): number;
(n: typeof f): number;
}): string;
}): number;
declare function f(n: typeof f): string;
declare function f(n: typeof g): string;
declare function g(n: typeof g): number;
declare function g(n: typeof f): number;
declare var b: any;
declare function b1(): () => typeof b1;
declare function foo(): () => typeof foo;
declare var foo1: () => typeof foo;
declare var foo2: () => typeof foo;
declare function b1(): typeof b1;
declare function foo(): typeof foo;
declare var foo1: typeof foo;
declare var foo2: typeof foo;
declare var foo3: any;
declare var x: any;
declare function foo5(x: number): (x: number) => number;
@@ -58,6 +58,8 @@ var A;
//// [declFileWithExtendsClauseThatHasItsContainerNameConflict.d.ts]
declare module A.B.C {
class B {
}
}
declare module A.B {
class EventManager {
@@ -0,0 +1,32 @@
==== tests/cases/compiler/declInput-2.ts (5 errors) ====
module M {
class C { }
export class E {}
export interface I1 {}
interface I2 {}
export class D {
private c: C; // don't generate
public m1: number;
public m2: string;
public m22: C; // don't generate
~~~~~~~~~~~~~~
!!! Public property 'm22' of exported class has or is using private name 'C'.
public m23: E;
public m24: I1;
public m25: I2; // don't generate
~~~~~~~~~~~~~~~
!!! Public property 'm25' of exported class has or is using private name 'I2'.
public m232(): E { return null;}
public m242(): I1 { return null; }
public m252(): I2 { return null; } // don't generate
~~~~
!!! Return type of public method from exported class has or is using private name 'I2'.
public m26(i:I1) {}
public m262(i:I2) {}
~~~~
!!! Parameter 'i' of public method from exported class has or is using private name 'I2'.
public m3():C { return new C(); }
~~
!!! Return type of public method from exported class has or is using private name 'C'.
}
}
-62
View File
@@ -58,65 +58,3 @@ var M;
})();
M.D = D;
})(M || (M = {}));
//// [declInput-2.d.ts]
declare module M {
class E {
}
interface I1 {
}
class D {
private c;
m1: number;
m2: string;
m22: C;
m23: E;
m24: I1;
m25: I2;
m232(): E;
m242(): I1;
m252(): I2;
m26(i: I1): void;
m262(i: I2): void;
m3(): C;
}
}
//// [DtsFileErrors]
==== tests/cases/compiler/declInput-2.d.ts (5 errors) ====
declare module M {
class E {
}
interface I1 {
}
class D {
private c;
m1: number;
m2: string;
m22: C;
~
!!! Cannot find name 'C'.
m23: E;
m24: I1;
m25: I2;
~~
!!! Cannot find name 'I2'.
m232(): E;
m242(): I1;
m252(): I2;
~~
!!! Cannot find name 'I2'.
m26(i: I1): void;
m262(i: I2): void;
~~
!!! Cannot find name 'I2'.
m3(): C;
~
!!! Cannot find name 'C'.
}
}
@@ -28,7 +28,6 @@ export module M.P {
export interface I { }
}
export import im = M.P.f;
// Bug 887180: Invalid .d.ts when an aliased entity is referenced, and a different entity is closer in scope
export var a = M.a; // emitted incorrectly as typeof f
export var b = M.b; // ok
export var c = M.c; // ok
@@ -145,6 +144,7 @@ declare module f {
}
export = f;
//// [declarationEmit_nameConflicts_0.d.ts]
import im = require('declarationEmit_nameConflicts_1');
export declare module M {
function f(): void;
class C {
@@ -169,10 +169,10 @@ export declare module M.P {
}
}
export import im = M.P.f;
var a: () => void;
var a: typeof M.f;
var b: typeof M.C;
var c: typeof M.N;
var g: () => void;
var g: typeof M.c.g;
var d: typeof M.d;
}
export declare module M.Q {
@@ -186,74 +186,10 @@ export declare module M.Q {
}
interface b extends M.C {
}
interface I extends M.N.I {
interface I extends M.c.I {
}
module c {
interface I extends M.N.I {
interface I extends M.c.I {
}
}
}
//// [DtsFileErrors]
==== tests/cases/compiler/declarationEmit_nameConflicts_0.d.ts (1 errors) ====
export declare module M {
function f(): void;
class C {
}
module N {
function g(): void;
interface I {
}
}
export import a = M.f;
export import b = M.C;
export import c = N;
export import d = im;
~~~~~~~~~~~~~~~~~~~~~
!!! Cannot find name 'im'.
}
export declare module M.P {
function f(): void;
class C {
}
module N {
function g(): void;
interface I {
}
}
export import im = M.P.f;
var a: () => void;
var b: typeof M.C;
var c: typeof M.N;
var g: () => void;
var d: typeof M.d;
}
export declare module M.Q {
function f(): void;
class C {
}
module N {
function g(): void;
interface I {
}
}
interface b extends M.C {
}
interface I extends M.N.I {
}
module c {
interface I extends M.N.I {
}
}
}
==== tests/cases/compiler/declarationEmit_nameConflicts_1.d.ts (0 errors) ====
declare module f {
class c {
}
}
export = f;
@@ -9,7 +9,6 @@ module X.Y.base {
}
module X.Y.base.Z {
// Bug 887180
export var f = X.Y.base.f; // Should be base.f
export var C = X.Y.base.C; // Should be base.C
export var M = X.Y.base.M; // Should be base.M
@@ -72,7 +71,7 @@ declare module X.Y.base {
}
}
declare module X.Y.base.Z {
var f: () => void;
var f: typeof base.f;
var C: typeof base.C;
var M: typeof base.M;
var E: typeof base.E;
@@ -20,7 +20,6 @@ module M.P {
export enum D {
f
}
// Bug 887180
export var v: M.D; // ok
export var w = M.D.f; // error, should be typeof M.D.f
export var x = M.C.f; // error, should be typeof M.C.f
@@ -111,7 +110,7 @@ declare module M.P {
f = 0,
}
var v: M.D;
var w: () => void;
var x: () => void;
var x: () => void;
var w: typeof M.D.f;
var x: typeof M.C.f;
var x: typeof M.C.f;
}
@@ -1,5 +1,4 @@
//// [declarationEmit_nameConflictsWithAlias.ts]
// Bug 887180
export module C { export interface I { } }
export import v = C;
export module M {
@@ -1,138 +1,47 @@
==== tests/cases/conformance/types/members/duplicateStringIndexers.ts (52 errors) ====
==== tests/cases/conformance/types/members/duplicateStringIndexers.ts (6 errors) ====
// it is an error to have duplicate index signatures of the same kind in a type
interface Number {
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toExponential' of type '(fractionDigits?: number) => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toFixed' of type '(fractionDigits?: number) => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toPrecision' of type '(precision?: number) => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toString' of type '(radix?: number) => string' is not assignable to string index type 'string'.
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
module test {
interface Number {
[x: string]: string;
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! Duplicate string index signature.
}
}
interface String {
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! Property 'charAt' of type '(pos: number) => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'charCodeAt' of type '(index: number) => number' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'concat' of type '(...strings: string[]) => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'indexOf' of type '(searchString: string, position?: number) => number' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'lastIndexOf' of type '(searchString: string, position?: number) => number' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'length' of type 'number' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'localeCompare' of type '(that: string) => number' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'match' of type '{ (regexp: string): string[]; (regexp: RegExp): string[]; }' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'replace' of type '{ (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; }' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'search' of type '{ (regexp: string): number; (regexp: RegExp): number; }' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'slice' of type '(start?: number, end?: number) => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'split' of type '{ (separator: string, limit?: number): string[]; (separator: RegExp, limit?: number): string[]; }' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'substr' of type '(from: number, length?: number) => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'substring' of type '(start: number, end?: number) => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toLocaleLowerCase' of type '() => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toLocaleUpperCase' of type '() => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toLowerCase' of type '() => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toString' of type '() => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'toUpperCase' of type '() => string' is not assignable to string index type 'string'.
~~~~~~~~~~~~~~~~~~~~
!!! Property 'trim' of type '() => string' is not assignable to string index type 'string'.
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
interface String {
[x: string]: string;
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! Duplicate string index signature.
}
}
interface Array<T> {
[x: string]: T;
~~~~~~~~~~~~~~~
!!! Property 'concat' of type '{ <U extends T[]>(...items: U[]): T[]; (...items: T[]): T[]; }' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'every' of type '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => boolean' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'filter' of type '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => T[]' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'forEach' of type '(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'indexOf' of type '(searchElement: T, fromIndex?: number) => number' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'join' of type '(separator?: string) => string' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'lastIndexOf' of type '(searchElement: T, fromIndex?: number) => number' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'length' of type 'number' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'map' of type '<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'pop' of type '() => T' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'push' of type '(...items: T[]) => number' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'reduce' of type '{ (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; }' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'reduceRight' of type '{ (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; <U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; }' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'reverse' of type '() => T[]' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'shift' of type '() => T' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'slice' of type '(start?: number, end?: number) => T[]' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'some' of type '(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => boolean' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'sort' of type '(compareFn?: (a: T, b: T) => number) => T[]' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'splice' of type '{ (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; }' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'toLocaleString' of type '() => string' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'toString' of type '() => string' is not assignable to string index type 'T'.
~~~~~~~~~~~~~~~
!!! Property 'unshift' of type '(...items: T[]) => number' is not assignable to string index type 'T'.
[x: string]: T;
~~~~~~~~~~~~~~~
interface Array<T> {
[x: string]: T;
[x: string]: T;
~~~~~~~~~~~~~~~
!!! Duplicate string index signature.
}
}
class C {
[x: string]: string;
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
class C {
[x: string]: string;
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! Duplicate string index signature.
}
}
interface I {
[x: string]: string;
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
interface I {
[x: string]: string;
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! Duplicate string index signature.
}
}
var a: {
[x: string]: string;
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
var a: {
[x: string]: string;
[x: string]: string;
~~~~~~~~~~~~~~~~~~~~
!!! Duplicate string index signature.
}
}
@@ -1,42 +1,46 @@
//// [duplicateStringIndexers.ts]
// it is an error to have duplicate index signatures of the same kind in a type
interface Number {
[x: string]: string;
[x: string]: string;
}
module test {
interface Number {
[x: string]: string;
[x: string]: string;
}
interface String {
[x: string]: string;
[x: string]: string;
}
interface String {
[x: string]: string;
[x: string]: string;
}
interface Array<T> {
[x: string]: T;
[x: string]: T;
}
interface Array<T> {
[x: string]: T;
[x: string]: T;
}
class C {
[x: string]: string;
[x: string]: string;
}
class C {
[x: string]: string;
[x: string]: string;
}
interface I {
[x: string]: string;
[x: string]: string;
}
interface I {
[x: string]: string;
[x: string]: string;
}
var a: {
[x: string]: string;
[x: string]: string;
var a: {
[x: string]: string;
[x: string]: string;
}
}
//// [duplicateStringIndexers.js]
var C = (function () {
function C() {
}
return C;
})();
var a;
var test;
(function (test) {
var C = (function () {
function C() {
}
return C;
})();
var a;
})(test || (test = {}));
@@ -68,7 +68,7 @@
var m: number[] = e;
~
!!! Type 'E' is not assignable to type 'number[]':
!!! Property 'concat' is missing in type 'Number'.
!!! Property 'length' is missing in type 'Number'.
var n: { foo: string } = e;
~
!!! Type 'E' is not assignable to type '{ foo: string; }':
+5
View File
@@ -14,4 +14,9 @@ declare module mAmbient {
//// [enumDecl1.d.ts]
declare module mAmbient {
enum e {
x,
y,
z,
}
}
+2 -20
View File
@@ -46,23 +46,5 @@ declare class Widget1 {
//// [exporter.d.ts]
export import w = require('./w1');
//// [consumer.d.ts]
export declare function w(): Widget1;
//// [DtsFileErrors]
==== tests/cases/compiler/consumer.d.ts (1 errors) ====
export declare function w(): Widget1;
~~~~~~~
!!! Cannot find name 'Widget1'.
==== tests/cases/compiler/w1.d.ts (0 errors) ====
export = Widget1;
declare class Widget1 {
name: string;
}
==== tests/cases/compiler/exporter.d.ts (0 errors) ====
export import w = require('./w1');
import e = require('./exporter');
export declare function w(): e.w;
@@ -38,23 +38,5 @@ interface Widget1 {
//// [exporter.d.ts]
export import w = require('./w1');
//// [consumer.d.ts]
export declare function w(): Widget1;
//// [DtsFileErrors]
==== tests/cases/compiler/consumer.d.ts (1 errors) ====
export declare function w(): Widget1;
~~~~~~~
!!! Cannot find name 'Widget1'.
==== tests/cases/compiler/w1.d.ts (0 errors) ====
export = Widget1;
interface Widget1 {
name: string;
}
==== tests/cases/compiler/exporter.d.ts (0 errors) ====
export import w = require('./w1');
import e = require('./exporter');
export declare function w(): e.w;
+10 -13
View File
@@ -134,29 +134,26 @@ var f2 = function () {
//// [funcdecl.d.ts]
declare function simpleFunc(): string;
declare var simpleFuncVar: () => string;
declare var simpleFuncVar: typeof simpleFunc;
declare function anotherFuncNoReturn(): void;
declare var anotherFuncNoReturnVar: () => void;
declare var anotherFuncNoReturnVar: typeof anotherFuncNoReturn;
declare function withReturn(): string;
declare var withReturnVar: () => string;
declare var withReturnVar: typeof withReturn;
declare function withParams(a: string): string;
declare var withparamsVar: (a: string) => string;
declare var withparamsVar: typeof withParams;
declare function withMultiParams(a: number, b: any, c: Object): number;
declare var withMultiParamsVar: (a: number, b: any, c: Object) => number;
declare var withMultiParamsVar: typeof withMultiParams;
declare function withOptionalParams(a?: string): void;
declare var withOptionalParamsVar: (a?: string) => void;
declare var withOptionalParamsVar: typeof withOptionalParams;
declare function withInitializedParams(a: string, b0: any, b?: number, c?: string): void;
declare var withInitializedParamsVar: (a: string, b0: any, b?: number, c?: string) => void;
declare var withInitializedParamsVar: typeof withInitializedParams;
declare function withOptionalInitializedParams(a: string, c?: string): void;
declare var withOptionalInitializedParamsVar: (a: string, c?: string) => void;
declare var withOptionalInitializedParamsVar: typeof withOptionalInitializedParams;
declare function withRestParams(a: string, ...myRestParameter: number[]): number[];
declare var withRestParamsVar: (a: string, ...myRestParameter: number[]) => number[];
declare var withRestParamsVar: typeof withRestParams;
declare function overload1(n: number): string;
declare function overload1(s: string): string;
declare var withOverloadSignature: {
(n: number): string;
(s: string): string;
};
declare var withOverloadSignature: typeof overload1;
declare function f(n: () => void): void;
declare module m2 {
function foo(n: () => void): void;
@@ -8,14 +8,4 @@ var x = function somefn() {
//// [functionExpressionReturningItself.d.ts]
declare var x: () => typeof somefn;
//// [DtsFileErrors]
==== tests/cases/compiler/functionExpressionReturningItself.d.ts (1 errors) ====
declare var x: () => typeof somefn;
~~~~~~
!!! Cannot find name 'somefn'.
declare var x: () => any;
@@ -10,4 +10,4 @@ function somefn() {
//// [functionReturningItself.d.ts]
declare function somefn(): () => typeof somefn;
declare function somefn(): typeof somefn;
@@ -4,7 +4,7 @@
!!! Cannot compile external modules unless the '--module' flag is provided.
~~~~~~~~~~~~~~~
!!! Class 'ObservableArray<T>' incorrectly implements interface 'T[]':
!!! Property 'join' is missing in type 'ObservableArray<T>'.
!!! Property 'length' is missing in type 'ObservableArray<T>'.
concat<U extends T[]>(...items: U[]): T[];
concat(...items: T[]): T[];
}
@@ -1,83 +0,0 @@
==== tests/cases/compiler/importDecl_1.ts (1 errors) ====
///<reference path='importDecl_require.ts'/>
///<reference path='importDecl_require1.ts'/>
///<reference path='importDecl_require2.ts'/>
///<reference path='importDecl_require3.ts'/>
///<reference path='importDecl_require4.ts'/>
import m4 = require("importDecl_require"); // Emit used
export var x4 = m4.x;
export var d4 = m4.d;
export var f4 = m4.foo();
export module m1 {
export var x2 = m4.x;
export var d2 = m4.d;
export var f2 = m4.foo();
var x3 = m4.x;
var d3 = m4.d;
var f3 = m4.foo();
}
//Emit global only usage
import glo_m4 = require("importDecl_require1");
export var useGlo_m4_x4 = glo_m4.x;
~
!!! Property 'x' does not exist on type 'typeof "tests/cases/compiler/importDecl_require1"'.
export var useGlo_m4_d4 = glo_m4.d;
export var useGlo_m4_f4 = glo_m4.foo();
//Emit even when used just in function type
import fncOnly_m4 = require("importDecl_require2");
export var useFncOnly_m4_f4 = fncOnly_m4.foo();
// only used privately no need to emit
import private_m4 = require("importDecl_require3");
export module usePrivate_m4_m1 {
var x3 = private_m4.x;
var d3 = private_m4.d;
var f3 = private_m4.foo();
}
// Do not emit unused import
import m5 = require("importDecl_require4");
export var d = m5.foo2();
// Do not emit multiple used import statements
import multiImport_m4 = require("importDecl_require"); // Emit used
export var useMultiImport_m4_x4 = multiImport_m4.x;
export var useMultiImport_m4_d4 = multiImport_m4.d;
export var useMultiImport_m4_f4 = multiImport_m4.foo();
==== tests/cases/compiler/importDecl_require.ts (0 errors) ====
export class d {
foo: string;
}
export var x: d;
export function foo(): d { return null; }
==== tests/cases/compiler/importDecl_require1.ts (0 errors) ====
export class d {
bar: string;
}
var x: d;
export function foo(): d { return null; }
==== tests/cases/compiler/importDecl_require2.ts (0 errors) ====
export class d {
baz: string;
}
export var x: d;
export function foo(): d { return null; }
==== tests/cases/compiler/importDecl_require3.ts (0 errors) ====
export class d {
bing: string;
}
export var x: d;
export function foo(): d { return null; }
==== tests/cases/compiler/importDecl_require4.ts (0 errors) ====
import m4 = require("importDecl_require");
export function foo2(): m4.d { return null; }
+54 -2
View File
@@ -55,7 +55,6 @@ export module m1 {
//Emit global only usage
import glo_m4 = require("importDecl_require1");
export var useGlo_m4_x4 = glo_m4.x;
export var useGlo_m4_d4 = glo_m4.d;
export var useGlo_m4_f4 = glo_m4.foo();
@@ -150,7 +149,6 @@ exports.f4 = m4.foo();
})(exports.m1 || (exports.m1 = {}));
var m1 = exports.m1;
var glo_m4 = require("importDecl_require1");
exports.useGlo_m4_x4 = glo_m4.x;
exports.useGlo_m4_d4 = glo_m4.d;
exports.useGlo_m4_f4 = glo_m4.foo();
var fncOnly_m4 = require("importDecl_require2");
@@ -168,3 +166,57 @@ var multiImport_m4 = require("importDecl_require");
exports.useMultiImport_m4_x4 = multiImport_m4.x;
exports.useMultiImport_m4_d4 = multiImport_m4.d;
exports.useMultiImport_m4_f4 = multiImport_m4.foo();
//// [importDecl_require.d.ts]
export declare class d {
foo: string;
}
export declare var x: d;
export declare function foo(): d;
//// [importDecl_require1.d.ts]
export declare class d {
bar: string;
}
export declare function foo(): d;
//// [importDecl_require2.d.ts]
export declare class d {
baz: string;
}
export declare var x: d;
export declare function foo(): d;
//// [importDecl_require3.d.ts]
export declare class d {
bing: string;
}
export declare var x: d;
export declare function foo(): d;
//// [importDecl_require4.d.ts]
import m4 = require("importDecl_require");
export declare function foo2(): m4.d;
//// [importDecl_1.d.ts]
/// <reference path='importDecl_require.d.ts' />
/// <reference path='importDecl_require1.d.ts' />
/// <reference path='importDecl_require2.d.ts' />
/// <reference path='importDecl_require3.d.ts' />
/// <reference path='importDecl_require4.d.ts' />
import m4 = require("importDecl_require");
export declare var x4: m4.d;
export declare var d4: typeof m4.d;
export declare var f4: m4.d;
export declare module m1 {
var x2: m4.d;
var d2: typeof m4.d;
var f2: m4.d;
}
import glo_m4 = require("importDecl_require1");
export declare var useGlo_m4_d4: typeof glo_m4.d;
export declare var useGlo_m4_f4: glo_m4.d;
import fncOnly_m4 = require("importDecl_require2");
export declare var useFncOnly_m4_f4: fncOnly_m4.d;
export declare module usePrivate_m4_m1 {
}
export declare var d: m4.d;
export declare var useMultiImport_m4_x4: m4.d;
export declare var useMultiImport_m4_d4: typeof m4.d;
export declare var useMultiImport_m4_f4: m4.d;
@@ -28,20 +28,5 @@ export declare class B {
}
//// [importDeclarationUsedAsTypeQuery_1.d.ts]
/// <reference path='importDeclarationUsedAsTypeQuery_require.d.ts' />
import a = require('importDeclarationUsedAsTypeQuery_require');
export declare var x: typeof a;
//// [DtsFileErrors]
==== tests/cases/compiler/importDeclarationUsedAsTypeQuery_1.d.ts (1 errors) ====
/// <reference path='importDeclarationUsedAsTypeQuery_require.d.ts' />
export declare var x: typeof a;
~
!!! Cannot find name 'a'.
==== tests/cases/compiler/importDeclarationUsedAsTypeQuery_require.d.ts (0 errors) ====
export declare class B {
id: number;
}
@@ -32,21 +32,6 @@ declare module a {
}
}
declare module c {
import b = a.c;
var x: b;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasClass.d.ts (1 errors) ====
declare module a {
class c {
}
}
declare module c {
var x: b;
~
!!! Cannot find name 'b'.
}
@@ -47,25 +47,7 @@ export declare module x {
}
export declare module m2 {
module m3 {
import c = x.c;
var cProp: c;
}
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasClassInsideLocalModuleWithoutExport.d.ts (1 errors) ====
export declare module x {
class c {
foo(a: number): number;
}
}
export declare module m2 {
module m3 {
var cProp: c;
~
!!! Cannot find name 'c'.
}
}
@@ -35,19 +35,5 @@ export declare module x {
foo(a: number): number;
}
}
import xc = x.c;
export declare var cProp: xc;
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasClassInsideTopLevelModuleWithoutExport.d.ts (1 errors) ====
export declare module x {
class c {
foo(a: number): number;
}
}
export declare var cProp: xc;
~~
!!! Cannot find name 'xc'.
+1 -19
View File
@@ -39,24 +39,6 @@ declare module a {
}
}
declare module c {
import b = a.weekend;
var bVal: b;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasEnum.d.ts (1 errors) ====
declare module a {
enum weekend {
Friday = 0,
Saturday = 1,
Sunday = 2,
}
}
declare module c {
var bVal: b;
~
!!! Cannot find name 'b'.
}
@@ -39,24 +39,6 @@ export declare module a {
}
}
export declare module c {
import b = a.weekend;
var bVal: b;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasEnumInsideLocalModuleWithoutExport.d.ts (1 errors) ====
export declare module a {
enum weekend {
Friday = 0,
Saturday = 1,
Sunday = 2,
}
}
export declare module c {
var bVal: b;
~
!!! Cannot find name 'b'.
}
@@ -35,21 +35,5 @@ export declare module a {
Sunday = 2,
}
}
import b = a.weekend;
export declare var bVal: b;
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasEnumInsideTopLevelModuleWithoutExport.d.ts (1 errors) ====
export declare module a {
enum weekend {
Friday = 0,
Saturday = 1,
Sunday = 2,
}
}
export declare var bVal: b;
~
!!! Cannot find name 'b'.
@@ -33,6 +33,7 @@ declare module a {
function foo(x: number): number;
}
declare module c {
import b = a.foo;
var bVal: number;
var bVal2: (x: number) => number;
var bVal2: typeof b;
}
@@ -35,5 +35,5 @@ export declare module a {
export declare module c {
export import b = a.foo;
var bVal: number;
var bVal2: (x: number) => number;
var bVal2: typeof b;
}
@@ -33,5 +33,6 @@ export declare module a {
function foo(x: number): number;
}
export declare module c {
var bVal2: (x: number) => number;
import b = a.foo;
var bVal2: typeof b;
}
@@ -31,4 +31,4 @@ export declare module a {
}
export import b = a.foo;
export declare var bVal: number;
export declare var bVal2: (x: number) => number;
export declare var bVal2: typeof b;
@@ -27,5 +27,6 @@ exports.bVal2 = b;
export declare module a {
function foo(x: number): number;
}
import b = a.foo;
export declare var bVal: number;
export declare var bVal2: (x: number) => number;
export declare var bVal2: typeof b;
@@ -39,23 +39,6 @@ declare module a {
}
}
declare module c {
import b = a.b;
var x: b.c;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasInitializedModule.d.ts (1 errors) ====
declare module a {
module b {
class c {
}
}
}
declare module c {
var x: b.c;
~~~
!!! Cannot find name 'b'.
}
@@ -39,23 +39,6 @@ export declare module a {
}
}
export declare module c {
import b = a.b;
var x: b.c;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasInitializedModuleInsideLocalModuleWithoutExport.d.ts (1 errors) ====
export declare module a {
module b {
class c {
}
}
}
export declare module c {
var x: b.c;
~~~
!!! Cannot find name 'b'.
}
@@ -35,20 +35,5 @@ export declare module a {
}
}
}
import b = a.b;
export declare var x: b.c;
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasInitializedModuleInsideTopLevelModuleWithoutExport.d.ts (1 errors) ====
export declare module a {
module b {
class c {
}
}
}
export declare var x: b.c;
~~~
!!! Cannot find name 'b'.
@@ -23,21 +23,6 @@ declare module a {
}
}
declare module c {
import b = a.I;
var x: b;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasInterface.d.ts (1 errors) ====
declare module a {
interface I {
}
}
declare module c {
var x: b;
~
!!! Cannot find name 'b'.
}
@@ -25,21 +25,6 @@ export declare module a {
}
}
export declare module c {
import b = a.I;
var x: b;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasInterfaceInsideLocalModuleWithoutExport.d.ts (1 errors) ====
export declare module a {
interface I {
}
}
export declare module c {
var x: b;
~
!!! Cannot find name 'b'.
}
@@ -19,18 +19,5 @@ export declare module a {
interface I {
}
}
import b = a.I;
export declare var x: b;
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasInterfaceInsideTopLevelModuleWithoutExport.d.ts (1 errors) ====
export declare module a {
interface I {
}
}
export declare var x: b;
~
!!! Cannot find name 'b'.
@@ -30,24 +30,6 @@ declare module a {
}
}
declare module c {
import b = a.b;
var x: b.I;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasUninitializedModule.d.ts (1 errors) ====
declare module a {
module b {
interface I {
foo(): any;
}
}
}
declare module c {
var x: b.I;
~~~
!!! Cannot find name 'b'.
}
@@ -30,24 +30,6 @@ export declare module a {
}
}
export declare module c {
import b = a.b;
var x: b.I;
}
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasUninitializedModuleInsideLocalModuleWithoutExport.d.ts (1 errors) ====
export declare module a {
module b {
interface I {
foo(): any;
}
}
}
export declare module c {
var x: b.I;
~~~
!!! Cannot find name 'b'.
}
@@ -25,21 +25,5 @@ export declare module a {
}
}
}
import b = a.b;
export declare var x: b.I;
//// [DtsFileErrors]
==== tests/cases/compiler/internalAliasUninitializedModuleInsideTopLevelModuleWithoutExport.d.ts (1 errors) ====
export declare module a {
module b {
interface I {
foo(): any;
}
}
}
export declare var x: b.I;
~~~
!!! Cannot find name 'b'.
@@ -18,3 +18,11 @@ var a;
})(a.b || (a.b = {}));
var b = a.b;
})(a || (a = {}));
//// [internalAliasWithDottedNameEmit.d.ts]
declare module a.b.c {
var d: any;
}
declare module a.e.f {
}
@@ -44,33 +44,9 @@ declare module "SubModule" {
}
//// [missingImportAfterModuleImport_1.d.ts]
/// <reference path='missingImportAfterModuleImport_0.d.ts' />
import SubModule = require('SubModule');
declare class MainModule {
SubModule: SubModule;
constructor();
}
export = MainModule;
//// [DtsFileErrors]
==== tests/cases/compiler/missingImportAfterModuleImport_1.d.ts (1 errors) ====
/// <reference path='missingImportAfterModuleImport_0.d.ts' />
declare class MainModule {
SubModule: SubModule;
~~~~~~~~~
!!! Cannot find name 'SubModule'.
constructor();
}
export = MainModule;
==== tests/cases/compiler/missingImportAfterModuleImport_0.d.ts (0 errors) ====
declare module "SubModule" {
class SubModule {
static StaticVar: number;
InstanceVar: number;
constructor();
}
export = SubModule;
}
@@ -14,4 +14,10 @@ declare module outer {
//// [moduleOuterQualification.d.ts]
declare module outer {
interface Beta {
}
module inner {
interface Beta extends outer.Beta {
}
}
}
@@ -1,26 +0,0 @@
==== tests/cases/compiler/consumer.ts (0 errors) ====
import Drawing = require('./Drawing');
var addr = new Drawing.Math.Adder();
==== tests/cases/compiler/Drawing.ts (0 errors) ====
export import Math = require('Math/Math')
==== tests/cases/compiler/Math/Math.ts (0 errors) ====
import Adder = require('Math/Adder');
var Math = {
Adder:Adder
};
export = Math
==== tests/cases/compiler/Math/Adder.ts (1 errors) ====
class Adder {
add(a: number, b: number) {
}
}
export = Adder;
~~~~~~~~~~~~~~~
!!! Cannot compile external modules unless the '--module' flag is provided.
@@ -0,0 +1,63 @@
//// [tests/cases/compiler/multiImportExport.ts] ////
//// [consumer.ts]
import Drawing = require('./Drawing');
var addr = new Drawing.Math.Adder();
//// [Drawing.ts]
export import Math = require('Math/Math')
//// [Math.ts]
import Adder = require('Math/Adder');
var Math = {
Adder:Adder
};
export = Math
//// [Adder.ts]
class Adder {
add(a: number, b: number) {
}
}
export = Adder;
//// [Adder.js]
var Adder = (function () {
function Adder() {
}
Adder.prototype.add = function (a, b) {
};
return Adder;
})();
module.exports = Adder;
//// [Math.js]
var Adder = require('Math/Adder');
var Math = {
Adder: Adder
};
module.exports = Math;
//// [Drawing.js]
exports.Math = require('Math/Math');
//// [consumer.js]
var Drawing = require('./Drawing');
var addr = new Drawing.Math.Adder();
//// [Adder.d.ts]
declare class Adder {
add(a: number, b: number): void;
}
export = Adder;
//// [Math.d.ts]
import Adder = require('Math/Adder');
declare var Math: {
Adder: typeof Adder;
};
export = Math;
//// [Drawing.d.ts]
export import Math = require('Math/Math');
//// [consumer.d.ts]
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,151 @@
==== tests/cases/compiler/privacyCannotNameAccessorDeclFile_consumer.ts (8 errors) ====
import exporter = require("privacyCannotNameAccessorDeclFile_exporter");
export class publicClassWithWithPrivateGetAccessorTypes {
static get myPublicStaticMethod() { // Error
~~~~~~~~~~~~~~~~~~~~
!!! 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
~~~~~~~~~~~~~~
!!! 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
~~~~~~~~~~~~~~~~~~~~~
!!! 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
~~~~~~~~~~~~~~~
!!! 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
~~~~~~~~~~~~~~~~~~~~
!!! 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
~~~~~~~~~~~~~~
!!! 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
~~~~~~~~~~~~~~~~~~~~~
!!! 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
~~~~~~~~~~~~~~~
!!! 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();
}
@@ -0,0 +1,410 @@
//// [tests/cases/compiler/privacyCannotNameAccessorDeclFile.ts] ////
//// [privacyCannotNameAccessorDeclFile_GlobalWidgets.ts]
declare module "GlobalWidgets" {
export class Widget3 {
name: string;
}
export function createWidget3(): Widget3;
export module SpecializedGlobalWidget {
export class Widget4 {
name: string;
}
function createWidget4(): Widget4;
}
}
//// [privacyCannotNameAccessorDeclFile_Widgets.ts]
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();
}
}
//// [privacyCannotNameAccessorDeclFile_exporter.ts]
///<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();
}
//// [privacyCannotNameAccessorDeclFile_consumer.ts]
import exporter = require("privacyCannotNameAccessorDeclFile_exporter");
export class publicClassWithWithPrivateGetAccessorTypes {
static get myPublicStaticMethod() { // Error
return exporter.createExportedWidget1();
}
private static get myPrivateStaticMethod() {
return exporter.createExportedWidget1();
}
get myPublicMethod() { // Error
return exporter.createExportedWidget1();
}
private get myPrivateMethod() {
return exporter.createExportedWidget1();
}
static get myPublicStaticMethod1() { // Error
return exporter.createExportedWidget3();
}
private static get myPrivateStaticMethod1() {
return exporter.createExportedWidget3();
}
get myPublicMethod1() { // Error
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
return exporter.createExportedWidget2();
}
get myPublicMethod() { // Error
return exporter.createExportedWidget2();
}
static get myPublicStaticMethod1() { // Error
return exporter.createExportedWidget4();
}
get myPublicMethod1() { // Error
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();
}
}
//// [privacyCannotNameAccessorDeclFile_GlobalWidgets.js]
//// [privacyCannotNameAccessorDeclFile_Widgets.js]
var Widget1 = (function () {
function Widget1() {
this.name = 'one';
}
return Widget1;
})();
exports.Widget1 = Widget1;
function createWidget1() {
return new Widget1();
}
exports.createWidget1 = createWidget1;
(function (SpecializedWidget) {
var Widget2 = (function () {
function Widget2() {
this.name = 'one';
}
return Widget2;
})();
SpecializedWidget.Widget2 = Widget2;
function createWidget2() {
return new Widget2();
}
SpecializedWidget.createWidget2 = createWidget2;
})(exports.SpecializedWidget || (exports.SpecializedWidget = {}));
var SpecializedWidget = exports.SpecializedWidget;
//// [privacyCannotNameAccessorDeclFile_exporter.js]
var Widgets = require("privacyCannotNameAccessorDeclFile_Widgets");
var Widgets1 = require("GlobalWidgets");
function createExportedWidget1() {
return Widgets.createWidget1();
}
exports.createExportedWidget1 = createExportedWidget1;
function createExportedWidget2() {
return Widgets.SpecializedWidget.createWidget2();
}
exports.createExportedWidget2 = createExportedWidget2;
function createExportedWidget3() {
return Widgets1.createWidget3();
}
exports.createExportedWidget3 = createExportedWidget3;
function createExportedWidget4() {
return Widgets1.SpecializedGlobalWidget.createWidget4();
}
exports.createExportedWidget4 = createExportedWidget4;
//// [privacyCannotNameAccessorDeclFile_consumer.js]
var exporter = require("privacyCannotNameAccessorDeclFile_exporter");
var publicClassWithWithPrivateGetAccessorTypes = (function () {
function publicClassWithWithPrivateGetAccessorTypes() {
}
Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", {
get: function () {
return exporter.createExportedWidget1();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPrivateStaticMethod", {
get: function () {
return exporter.createExportedWidget1();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes.prototype, "myPublicMethod", {
get: function () {
return exporter.createExportedWidget1();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes.prototype, "myPrivateMethod", {
get: function () {
return exporter.createExportedWidget1();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod1", {
get: function () {
return exporter.createExportedWidget3();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes, "myPrivateStaticMethod1", {
get: function () {
return exporter.createExportedWidget3();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes.prototype, "myPublicMethod1", {
get: function () {
return exporter.createExportedWidget3();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithWithPrivateGetAccessorTypes.prototype, "myPrivateMethod1", {
get: function () {
return exporter.createExportedWidget3();
},
enumerable: true,
configurable: true
});
return publicClassWithWithPrivateGetAccessorTypes;
})();
exports.publicClassWithWithPrivateGetAccessorTypes = publicClassWithWithPrivateGetAccessorTypes;
var privateClassWithWithPrivateGetAccessorTypes = (function () {
function privateClassWithWithPrivateGetAccessorTypes() {
}
Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod", {
get: function () {
return exporter.createExportedWidget1();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPrivateStaticMethod", {
get: function () {
return exporter.createExportedWidget1();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes.prototype, "myPublicMethod", {
get: function () {
return exporter.createExportedWidget1();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes.prototype, "myPrivateMethod", {
get: function () {
return exporter.createExportedWidget1();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPublicStaticMethod1", {
get: function () {
return exporter.createExportedWidget3();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes, "myPrivateStaticMethod1", {
get: function () {
return exporter.createExportedWidget3();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes.prototype, "myPublicMethod1", {
get: function () {
return exporter.createExportedWidget3();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithWithPrivateGetAccessorTypes.prototype, "myPrivateMethod1", {
get: function () {
return exporter.createExportedWidget3();
},
enumerable: true,
configurable: true
});
return privateClassWithWithPrivateGetAccessorTypes;
})();
var publicClassWithPrivateModuleGetAccessorTypes = (function () {
function publicClassWithPrivateModuleGetAccessorTypes() {
}
Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", {
get: function () {
return exporter.createExportedWidget2();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes.prototype, "myPublicMethod", {
get: function () {
return exporter.createExportedWidget2();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod1", {
get: function () {
return exporter.createExportedWidget4();
},
enumerable: true,
configurable: true
});
Object.defineProperty(publicClassWithPrivateModuleGetAccessorTypes.prototype, "myPublicMethod1", {
get: function () {
return exporter.createExportedWidget4();
},
enumerable: true,
configurable: true
});
return publicClassWithPrivateModuleGetAccessorTypes;
})();
exports.publicClassWithPrivateModuleGetAccessorTypes = publicClassWithPrivateModuleGetAccessorTypes;
var privateClassWithPrivateModuleGetAccessorTypes = (function () {
function privateClassWithPrivateModuleGetAccessorTypes() {
}
Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod", {
get: function () {
return exporter.createExportedWidget2();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes.prototype, "myPublicMethod", {
get: function () {
return exporter.createExportedWidget2();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes, "myPublicStaticMethod1", {
get: function () {
return exporter.createExportedWidget4();
},
enumerable: true,
configurable: true
});
Object.defineProperty(privateClassWithPrivateModuleGetAccessorTypes.prototype, "myPublicMethod1", {
get: function () {
return exporter.createExportedWidget4();
},
enumerable: true,
configurable: true
});
return privateClassWithPrivateModuleGetAccessorTypes;
})();
//// [privacyCannotNameAccessorDeclFile_GlobalWidgets.d.ts]
declare module "GlobalWidgets" {
class Widget3 {
name: string;
}
function createWidget3(): Widget3;
module SpecializedGlobalWidget {
class Widget4 {
name: string;
}
function createWidget4(): Widget4;
}
}
//// [privacyCannotNameAccessorDeclFile_Widgets.d.ts]
export declare class Widget1 {
name: string;
}
export declare function createWidget1(): Widget1;
export declare module SpecializedWidget {
class Widget2 {
name: string;
}
function createWidget2(): Widget2;
}
//// [privacyCannotNameAccessorDeclFile_exporter.d.ts]
/// <reference path='privacyCannotNameAccessorDeclFile_GlobalWidgets.d.ts' />
import Widgets = require("privacyCannotNameAccessorDeclFile_Widgets");
import Widgets1 = require("GlobalWidgets");
export declare function createExportedWidget1(): Widgets.Widget1;
export declare function createExportedWidget2(): Widgets.SpecializedWidget.Widget2;
export declare function createExportedWidget3(): Widgets1.Widget3;
export declare function createExportedWidget4(): Widgets1.SpecializedGlobalWidget.Widget4;
@@ -0,0 +1,123 @@
==== 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();
}
@@ -0,0 +1,238 @@
//// [tests/cases/compiler/privacyCannotNameVarTypeDeclFile.ts] ////
//// [privacyCannotNameVarTypeDeclFile_GlobalWidgets.ts]
declare module "GlobalWidgets" {
export class Widget3 {
name: string;
}
export function createWidget3(): Widget3;
export module SpecializedGlobalWidget {
export class Widget4 {
name: string;
}
function createWidget4(): Widget4;
}
}
//// [privacyCannotNameVarTypeDeclFile_Widgets.ts]
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();
}
}
//// [privacyCannotNameVarTypeDeclFile_exporter.ts]
///<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();
}
//// [privacyCannotNameVarTypeDeclFile_consumer.ts]
import exporter = require("privacyCannotNameVarTypeDeclFile_exporter");
export class publicClassWithWithPrivatePropertyTypes {
static myPublicStaticProperty = exporter.createExportedWidget1(); // Error
private static myPrivateStaticProperty = exporter.createExportedWidget1();
myPublicProperty = exporter.createExportedWidget1(); // Error
private myPrivateProperty = exporter.createExportedWidget1();
static myPublicStaticProperty1 = exporter.createExportedWidget3(); // Error
private static myPrivateStaticProperty1 = exporter.createExportedWidget3();
myPublicProperty1 = exporter.createExportedWidget3(); // Error
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
var privateVarWithPrivatePropertyTypes= exporter.createExportedWidget1();
export var publicVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3(); // Error
var privateVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3();
export class publicClassWithPrivateModulePropertyTypes {
static myPublicStaticProperty= exporter.createExportedWidget2(); // Error
myPublicProperty = exporter.createExportedWidget2(); // Error
static myPublicStaticProperty1 = exporter.createExportedWidget4(); // Error
myPublicProperty1 = exporter.createExportedWidget4(); // Error
}
export var publicVarWithPrivateModulePropertyTypes= exporter.createExportedWidget2(); // Error
export var publicVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4(); // Error
class privateClassWithPrivateModulePropertyTypes {
static myPublicStaticProperty= exporter.createExportedWidget2();
myPublicProperty= exporter.createExportedWidget2();
static myPublicStaticProperty1 = exporter.createExportedWidget4();
myPublicProperty1 = exporter.createExportedWidget4();
}
var privateVarWithPrivateModulePropertyTypes= exporter.createExportedWidget2();
var privateVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4();
//// [privacyCannotNameVarTypeDeclFile_GlobalWidgets.js]
//// [privacyCannotNameVarTypeDeclFile_Widgets.js]
var Widget1 = (function () {
function Widget1() {
this.name = 'one';
}
return Widget1;
})();
exports.Widget1 = Widget1;
function createWidget1() {
return new Widget1();
}
exports.createWidget1 = createWidget1;
(function (SpecializedWidget) {
var Widget2 = (function () {
function Widget2() {
this.name = 'one';
}
return Widget2;
})();
SpecializedWidget.Widget2 = Widget2;
function createWidget2() {
return new Widget2();
}
SpecializedWidget.createWidget2 = createWidget2;
})(exports.SpecializedWidget || (exports.SpecializedWidget = {}));
var SpecializedWidget = exports.SpecializedWidget;
//// [privacyCannotNameVarTypeDeclFile_exporter.js]
var Widgets = require("privacyCannotNameVarTypeDeclFile_Widgets");
var Widgets1 = require("GlobalWidgets");
function createExportedWidget1() {
return Widgets.createWidget1();
}
exports.createExportedWidget1 = createExportedWidget1;
function createExportedWidget2() {
return Widgets.SpecializedWidget.createWidget2();
}
exports.createExportedWidget2 = createExportedWidget2;
function createExportedWidget3() {
return Widgets1.createWidget3();
}
exports.createExportedWidget3 = createExportedWidget3;
function createExportedWidget4() {
return Widgets1.SpecializedGlobalWidget.createWidget4();
}
exports.createExportedWidget4 = createExportedWidget4;
//// [privacyCannotNameVarTypeDeclFile_consumer.js]
var exporter = require("privacyCannotNameVarTypeDeclFile_exporter");
var publicClassWithWithPrivatePropertyTypes = (function () {
function publicClassWithWithPrivatePropertyTypes() {
this.myPublicProperty = exporter.createExportedWidget1();
this.myPrivateProperty = exporter.createExportedWidget1();
this.myPublicProperty1 = exporter.createExportedWidget3();
this.myPrivateProperty1 = exporter.createExportedWidget3();
}
publicClassWithWithPrivatePropertyTypes.myPublicStaticProperty = exporter.createExportedWidget1();
publicClassWithWithPrivatePropertyTypes.myPrivateStaticProperty = exporter.createExportedWidget1();
publicClassWithWithPrivatePropertyTypes.myPublicStaticProperty1 = exporter.createExportedWidget3();
publicClassWithWithPrivatePropertyTypes.myPrivateStaticProperty1 = exporter.createExportedWidget3();
return publicClassWithWithPrivatePropertyTypes;
})();
exports.publicClassWithWithPrivatePropertyTypes = publicClassWithWithPrivatePropertyTypes;
var privateClassWithWithPrivatePropertyTypes = (function () {
function privateClassWithWithPrivatePropertyTypes() {
this.myPublicProperty = exporter.createExportedWidget1();
this.myPrivateProperty = exporter.createExportedWidget1();
this.myPublicProperty1 = exporter.createExportedWidget3();
this.myPrivateProperty1 = exporter.createExportedWidget3();
}
privateClassWithWithPrivatePropertyTypes.myPublicStaticProperty = exporter.createExportedWidget1();
privateClassWithWithPrivatePropertyTypes.myPrivateStaticProperty = exporter.createExportedWidget1();
privateClassWithWithPrivatePropertyTypes.myPublicStaticProperty1 = exporter.createExportedWidget3();
privateClassWithWithPrivatePropertyTypes.myPrivateStaticProperty1 = exporter.createExportedWidget3();
return privateClassWithWithPrivatePropertyTypes;
})();
exports.publicVarWithPrivatePropertyTypes = exporter.createExportedWidget1();
var privateVarWithPrivatePropertyTypes = exporter.createExportedWidget1();
exports.publicVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3();
var privateVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3();
var publicClassWithPrivateModulePropertyTypes = (function () {
function publicClassWithPrivateModulePropertyTypes() {
this.myPublicProperty = exporter.createExportedWidget2();
this.myPublicProperty1 = exporter.createExportedWidget4();
}
publicClassWithPrivateModulePropertyTypes.myPublicStaticProperty = exporter.createExportedWidget2();
publicClassWithPrivateModulePropertyTypes.myPublicStaticProperty1 = exporter.createExportedWidget4();
return publicClassWithPrivateModulePropertyTypes;
})();
exports.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes;
exports.publicVarWithPrivateModulePropertyTypes = exporter.createExportedWidget2();
exports.publicVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4();
var privateClassWithPrivateModulePropertyTypes = (function () {
function privateClassWithPrivateModulePropertyTypes() {
this.myPublicProperty = exporter.createExportedWidget2();
this.myPublicProperty1 = exporter.createExportedWidget4();
}
privateClassWithPrivateModulePropertyTypes.myPublicStaticProperty = exporter.createExportedWidget2();
privateClassWithPrivateModulePropertyTypes.myPublicStaticProperty1 = exporter.createExportedWidget4();
return privateClassWithPrivateModulePropertyTypes;
})();
var privateVarWithPrivateModulePropertyTypes = exporter.createExportedWidget2();
var privateVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4();
//// [privacyCannotNameVarTypeDeclFile_GlobalWidgets.d.ts]
declare module "GlobalWidgets" {
class Widget3 {
name: string;
}
function createWidget3(): Widget3;
module SpecializedGlobalWidget {
class Widget4 {
name: string;
}
function createWidget4(): Widget4;
}
}
//// [privacyCannotNameVarTypeDeclFile_Widgets.d.ts]
export declare class Widget1 {
name: string;
}
export declare function createWidget1(): Widget1;
export declare module SpecializedWidget {
class Widget2 {
name: string;
}
function createWidget2(): Widget2;
}
//// [privacyCannotNameVarTypeDeclFile_exporter.d.ts]
/// <reference path='privacyCannotNameVarTypeDeclFile_GlobalWidgets.d.ts' />
import Widgets = require("privacyCannotNameVarTypeDeclFile_Widgets");
import Widgets1 = require("GlobalWidgets");
export declare function createExportedWidget1(): Widgets.Widget1;
export declare function createExportedWidget2(): Widgets.SpecializedWidget.Widget2;
export declare function createExportedWidget3(): Widgets1.Widget3;
export declare function createExportedWidget4(): Widgets1.SpecializedGlobalWidget.Widget4;
@@ -30,3 +30,7 @@ var Query;
});
}
})(Query || (Query = {}));
//// [privacyCheckAnonymousFunctionParameter.d.ts]
export declare var x: number;
@@ -31,3 +31,7 @@ define(["require", "exports"], function (require, exports) {
}
})(Q || (Q = {}));
});
//// [privacyCheckAnonymousFunctionParameter2.d.ts]
export declare var x: number;
@@ -10,3 +10,11 @@ export interface B<T> extends A<T> {
//// [privacyCheckCallbackOfInterfaceMethodWithTypeParameter.js]
define(["require", "exports"], function (require, exports) {
});
//// [privacyCheckCallbackOfInterfaceMethodWithTypeParameter.d.ts]
export interface A<T> {
f1(callback: (p: T) => any): any;
}
export interface B<T> extends A<T> {
}
@@ -11,3 +11,14 @@ export = Foo;
//// [privacyCheckExportAssignmentOnExportedGenericInterface1.js]
var Foo;
module.exports = Foo;
//// [privacyCheckExportAssignmentOnExportedGenericInterface1.d.ts]
declare module Foo {
interface A<T> {
}
}
interface Foo<T> {
}
declare var Foo: new () => Foo.A<Foo<string>>;
export = Foo;
@@ -24,3 +24,13 @@ define(["require", "exports"], function (require, exports) {
})(Foo || (Foo = {}));
return Foo;
});
//// [privacyCheckExportAssignmentOnExportedGenericInterface2.d.ts]
export = Foo;
interface Foo<T> {
}
declare function Foo<T>(array: T[]): Foo<T>;
declare module Foo {
var x: string;
}
@@ -22,3 +22,17 @@ var Foo = (function () {
})();
module.exports = Foo;
//// [privacyCheckExternalModuleExportAssignmentOfGenericClass_1.js]
//// [privacyCheckExternalModuleExportAssignmentOfGenericClass_0.d.ts]
export = Foo;
declare class Foo<A> {
a: A;
constructor(a: A);
}
//// [privacyCheckExternalModuleExportAssignmentOfGenericClass_1.d.ts]
import Foo = require("privacyCheckExternalModuleExportAssignmentOfGenericClass_0");
export = Bar;
interface Bar {
foo: Foo<number>;
}
@@ -26,3 +26,12 @@ define(["require", "exports"], function (require, exports) {
})();
exports.B = B;
});
//// [privacyCheckOnTypeParameterReferenceInConstructorParameter.d.ts]
export declare class A<T1> {
constructor(callback: (self: A<T1>) => void);
}
export declare class B<T2> {
constructor(parent: T2);
}
@@ -1,8 +1,10 @@
==== tests/cases/compiler/privacyCheckTypeOfFunction.ts (1 errors) ====
==== tests/cases/compiler/privacyCheckTypeOfFunction.ts (2 errors) ====
function foo() {
}
export var x: typeof foo;
~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Cannot compile external modules unless the '--module' flag is provided.
~
!!! Exported variable 'x' has or is using private name 'foo'.
export var b = foo;
~
!!! Exported variable 'b' has or is using private name 'foo'.
@@ -0,0 +1,12 @@
//// [privacyCheckTypeOfFunction.ts]
function foo() {
}
export var x: typeof foo;
export var b = foo;
//// [privacyCheckTypeOfFunction.js]
function foo() {
}
exports.x;
exports.b = foo;
@@ -0,0 +1,11 @@
==== tests/cases/compiler/privacyCheckTypeOfInvisibleModuleError.ts (1 errors) ====
module Outer {
module Inner {
export var m: typeof Inner;
}
export var f: typeof Inner;
~
!!! Exported variable 'f' has or is using private name 'Inner'.
}
@@ -0,0 +1,11 @@
==== tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.ts (1 errors) ====
module Outer {
module Inner {
export var m: number;
}
export var f: typeof Inner; // Since we dont unwind inner any more, it is error here
~
!!! Exported variable 'f' has or is using private name 'Inner'.
}
@@ -17,21 +17,3 @@ var Outer;
})(Inner || (Inner = {}));
Outer.f;
})(Outer || (Outer = {}));
//// [privacyCheckTypeOfInvisibleModuleNoError.d.ts]
declare module Outer {
var f: typeof Inner;
}
//// [DtsFileErrors]
==== tests/cases/compiler/privacyCheckTypeOfInvisibleModuleNoError.d.ts (1 errors) ====
declare module Outer {
var f: typeof Inner;
~~~~~
!!! Cannot find name 'Inner'.
}
@@ -0,0 +1,203 @@
==== tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_consumer.ts (24 errors) ====
import exporter = require("privacyFunctionCannotNameParameterTypeDeclFile_exporter");
export class publicClassWithWithPrivateParmeterTypes {
static myPublicStaticMethod(param = exporter.createExportedWidget1()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of public static method from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
}
private static myPrivateStaticMethod(param = exporter.createExportedWidget1()) {
}
myPublicMethod(param = exporter.createExportedWidget1()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of public method from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
}
private myPrivateMethod(param = exporter.createExportedWidget1()) {
}
constructor(param = exporter.createExportedWidget1(), private param1 = exporter.createExportedWidget1(), public param2 = exporter.createExportedWidget1()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of constructor from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param1' of constructor from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param2' of constructor from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
}
}
export class publicClassWithWithPrivateParmeterTypes1 {
static myPublicStaticMethod(param = exporter.createExportedWidget3()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of public static method from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
}
private static myPrivateStaticMethod(param = exporter.createExportedWidget3()) {
}
myPublicMethod(param = exporter.createExportedWidget3()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of public method from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
}
private myPrivateMethod(param = exporter.createExportedWidget3()) {
}
constructor(param = exporter.createExportedWidget3(), private param1 = exporter.createExportedWidget3(), public param2 = exporter.createExportedWidget3()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of constructor from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param1' of constructor from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param2' of constructor from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
}
}
class privateClassWithWithPrivateParmeterTypes {
static myPublicStaticMethod(param = exporter.createExportedWidget1()) {
}
private static myPrivateStaticMethod(param = exporter.createExportedWidget1()) {
}
myPublicMethod(param = exporter.createExportedWidget1()) {
}
private myPrivateMethod(param = exporter.createExportedWidget1()) {
}
constructor(param = exporter.createExportedWidget1(), private param1 = exporter.createExportedWidget1(), public param2 = exporter.createExportedWidget1()) {
}
}
class privateClassWithWithPrivateParmeterTypes2 {
static myPublicStaticMethod(param = exporter.createExportedWidget3()) {
}
private static myPrivateStaticMethod(param = exporter.createExportedWidget3()) {
}
myPublicMethod(param = exporter.createExportedWidget3()) {
}
private myPrivateMethod(param = exporter.createExportedWidget3()) {
}
constructor(param = exporter.createExportedWidget3(), private param1 = exporter.createExportedWidget3(), public param2 = exporter.createExportedWidget3()) {
}
}
export function publicFunctionWithPrivateParmeterTypes(param = exporter.createExportedWidget1()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of exported function has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
}
function privateFunctionWithPrivateParmeterTypes(param = exporter.createExportedWidget1()) {
}
export function publicFunctionWithPrivateParmeterTypes1(param = exporter.createExportedWidget3()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of exported function has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
}
function privateFunctionWithPrivateParmeterTypes1(param = exporter.createExportedWidget3()) {
}
export class publicClassWithPrivateModuleParameterTypes {
static myPublicStaticMethod(param= exporter.createExportedWidget2()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of public static method from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
}
myPublicMethod(param= exporter.createExportedWidget2()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of public method from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
}
constructor(param= exporter.createExportedWidget2(), private param1= exporter.createExportedWidget2(), public param2= exporter.createExportedWidget2()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of constructor from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param1' of constructor from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param2' of constructor from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
}
}
export class publicClassWithPrivateModuleParameterTypes2 {
static myPublicStaticMethod(param= exporter.createExportedWidget4()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of public static method from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
}
myPublicMethod(param= exporter.createExportedWidget4()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of public method from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
}
constructor(param= exporter.createExportedWidget4(), private param1= exporter.createExportedWidget4(), public param2= exporter.createExportedWidget4()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of constructor from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param1' of constructor from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param2' of constructor from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
}
}
export function publicFunctionWithPrivateModuleParameterTypes(param= exporter.createExportedWidget2()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of exported function has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_Widgets" but cannot be named.
}
export function publicFunctionWithPrivateModuleParameterTypes1(param= exporter.createExportedWidget4()) { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Parameter 'param' of exported function has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
}
class privateClassWithPrivateModuleParameterTypes {
static myPublicStaticMethod(param= exporter.createExportedWidget2()) {
}
myPublicMethod(param= exporter.createExportedWidget2()) {
}
constructor(param= exporter.createExportedWidget2(), private param1= exporter.createExportedWidget2(), public param2= exporter.createExportedWidget2()) {
}
}
class privateClassWithPrivateModuleParameterTypes1 {
static myPublicStaticMethod(param= exporter.createExportedWidget4()) {
}
myPublicMethod(param= exporter.createExportedWidget4()) {
}
constructor(param= exporter.createExportedWidget4(), private param1= exporter.createExportedWidget4(), public param2= exporter.createExportedWidget4()) {
}
}
function privateFunctionWithPrivateModuleParameterTypes(param= exporter.createExportedWidget2()) {
}
function privateFunctionWithPrivateModuleParameterTypes1(param= exporter.createExportedWidget4()) {
}
==== tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile_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/privacyFunctionCannotNameParameterTypeDeclFile_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/privacyFunctionCannotNameParameterTypeDeclFile_exporter.ts (0 errors) ====
///<reference path='privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.ts'/>
import Widgets = require("privacyFunctionCannotNameParameterTypeDeclFile_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();
}
@@ -0,0 +1,424 @@
//// [tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile.ts] ////
//// [privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.ts]
declare module "GlobalWidgets" {
export class Widget3 {
name: string;
}
export function createWidget3(): Widget3;
export module SpecializedGlobalWidget {
export class Widget4 {
name: string;
}
function createWidget4(): Widget4;
}
}
//// [privacyFunctionCannotNameParameterTypeDeclFile_Widgets.ts]
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();
}
}
//// [privacyFunctionCannotNameParameterTypeDeclFile_exporter.ts]
///<reference path='privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.ts'/>
import Widgets = require("privacyFunctionCannotNameParameterTypeDeclFile_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();
}
//// [privacyFunctionCannotNameParameterTypeDeclFile_consumer.ts]
import exporter = require("privacyFunctionCannotNameParameterTypeDeclFile_exporter");
export class publicClassWithWithPrivateParmeterTypes {
static myPublicStaticMethod(param = exporter.createExportedWidget1()) { // Error
}
private static myPrivateStaticMethod(param = exporter.createExportedWidget1()) {
}
myPublicMethod(param = exporter.createExportedWidget1()) { // Error
}
private myPrivateMethod(param = exporter.createExportedWidget1()) {
}
constructor(param = exporter.createExportedWidget1(), private param1 = exporter.createExportedWidget1(), public param2 = exporter.createExportedWidget1()) { // Error
}
}
export class publicClassWithWithPrivateParmeterTypes1 {
static myPublicStaticMethod(param = exporter.createExportedWidget3()) { // Error
}
private static myPrivateStaticMethod(param = exporter.createExportedWidget3()) {
}
myPublicMethod(param = exporter.createExportedWidget3()) { // Error
}
private myPrivateMethod(param = exporter.createExportedWidget3()) {
}
constructor(param = exporter.createExportedWidget3(), private param1 = exporter.createExportedWidget3(), public param2 = exporter.createExportedWidget3()) { // Error
}
}
class privateClassWithWithPrivateParmeterTypes {
static myPublicStaticMethod(param = exporter.createExportedWidget1()) {
}
private static myPrivateStaticMethod(param = exporter.createExportedWidget1()) {
}
myPublicMethod(param = exporter.createExportedWidget1()) {
}
private myPrivateMethod(param = exporter.createExportedWidget1()) {
}
constructor(param = exporter.createExportedWidget1(), private param1 = exporter.createExportedWidget1(), public param2 = exporter.createExportedWidget1()) {
}
}
class privateClassWithWithPrivateParmeterTypes2 {
static myPublicStaticMethod(param = exporter.createExportedWidget3()) {
}
private static myPrivateStaticMethod(param = exporter.createExportedWidget3()) {
}
myPublicMethod(param = exporter.createExportedWidget3()) {
}
private myPrivateMethod(param = exporter.createExportedWidget3()) {
}
constructor(param = exporter.createExportedWidget3(), private param1 = exporter.createExportedWidget3(), public param2 = exporter.createExportedWidget3()) {
}
}
export function publicFunctionWithPrivateParmeterTypes(param = exporter.createExportedWidget1()) { // Error
}
function privateFunctionWithPrivateParmeterTypes(param = exporter.createExportedWidget1()) {
}
export function publicFunctionWithPrivateParmeterTypes1(param = exporter.createExportedWidget3()) { // Error
}
function privateFunctionWithPrivateParmeterTypes1(param = exporter.createExportedWidget3()) {
}
export class publicClassWithPrivateModuleParameterTypes {
static myPublicStaticMethod(param= exporter.createExportedWidget2()) { // Error
}
myPublicMethod(param= exporter.createExportedWidget2()) { // Error
}
constructor(param= exporter.createExportedWidget2(), private param1= exporter.createExportedWidget2(), public param2= exporter.createExportedWidget2()) { // Error
}
}
export class publicClassWithPrivateModuleParameterTypes2 {
static myPublicStaticMethod(param= exporter.createExportedWidget4()) { // Error
}
myPublicMethod(param= exporter.createExportedWidget4()) { // Error
}
constructor(param= exporter.createExportedWidget4(), private param1= exporter.createExportedWidget4(), public param2= exporter.createExportedWidget4()) { // Error
}
}
export function publicFunctionWithPrivateModuleParameterTypes(param= exporter.createExportedWidget2()) { // Error
}
export function publicFunctionWithPrivateModuleParameterTypes1(param= exporter.createExportedWidget4()) { // Error
}
class privateClassWithPrivateModuleParameterTypes {
static myPublicStaticMethod(param= exporter.createExportedWidget2()) {
}
myPublicMethod(param= exporter.createExportedWidget2()) {
}
constructor(param= exporter.createExportedWidget2(), private param1= exporter.createExportedWidget2(), public param2= exporter.createExportedWidget2()) {
}
}
class privateClassWithPrivateModuleParameterTypes1 {
static myPublicStaticMethod(param= exporter.createExportedWidget4()) {
}
myPublicMethod(param= exporter.createExportedWidget4()) {
}
constructor(param= exporter.createExportedWidget4(), private param1= exporter.createExportedWidget4(), public param2= exporter.createExportedWidget4()) {
}
}
function privateFunctionWithPrivateModuleParameterTypes(param= exporter.createExportedWidget2()) {
}
function privateFunctionWithPrivateModuleParameterTypes1(param= exporter.createExportedWidget4()) {
}
//// [privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.js]
//// [privacyFunctionCannotNameParameterTypeDeclFile_Widgets.js]
var Widget1 = (function () {
function Widget1() {
this.name = 'one';
}
return Widget1;
})();
exports.Widget1 = Widget1;
function createWidget1() {
return new Widget1();
}
exports.createWidget1 = createWidget1;
(function (SpecializedWidget) {
var Widget2 = (function () {
function Widget2() {
this.name = 'one';
}
return Widget2;
})();
SpecializedWidget.Widget2 = Widget2;
function createWidget2() {
return new Widget2();
}
SpecializedWidget.createWidget2 = createWidget2;
})(exports.SpecializedWidget || (exports.SpecializedWidget = {}));
var SpecializedWidget = exports.SpecializedWidget;
//// [privacyFunctionCannotNameParameterTypeDeclFile_exporter.js]
var Widgets = require("privacyFunctionCannotNameParameterTypeDeclFile_Widgets");
var Widgets1 = require("GlobalWidgets");
function createExportedWidget1() {
return Widgets.createWidget1();
}
exports.createExportedWidget1 = createExportedWidget1;
function createExportedWidget2() {
return Widgets.SpecializedWidget.createWidget2();
}
exports.createExportedWidget2 = createExportedWidget2;
function createExportedWidget3() {
return Widgets1.createWidget3();
}
exports.createExportedWidget3 = createExportedWidget3;
function createExportedWidget4() {
return Widgets1.SpecializedGlobalWidget.createWidget4();
}
exports.createExportedWidget4 = createExportedWidget4;
//// [privacyFunctionCannotNameParameterTypeDeclFile_consumer.js]
var exporter = require("privacyFunctionCannotNameParameterTypeDeclFile_exporter");
var publicClassWithWithPrivateParmeterTypes = (function () {
function publicClassWithWithPrivateParmeterTypes(param, param1, param2) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
if (param1 === void 0) { param1 = exporter.createExportedWidget1(); }
if (param2 === void 0) { param2 = exporter.createExportedWidget1(); }
this.param1 = param1;
this.param2 = param2;
}
publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
};
publicClassWithWithPrivateParmeterTypes.myPrivateStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
};
publicClassWithWithPrivateParmeterTypes.prototype.myPublicMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
};
publicClassWithWithPrivateParmeterTypes.prototype.myPrivateMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
};
return publicClassWithWithPrivateParmeterTypes;
})();
exports.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes;
var publicClassWithWithPrivateParmeterTypes1 = (function () {
function publicClassWithWithPrivateParmeterTypes1(param, param1, param2) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
if (param1 === void 0) { param1 = exporter.createExportedWidget3(); }
if (param2 === void 0) { param2 = exporter.createExportedWidget3(); }
this.param1 = param1;
this.param2 = param2;
}
publicClassWithWithPrivateParmeterTypes1.myPublicStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
};
publicClassWithWithPrivateParmeterTypes1.myPrivateStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
};
publicClassWithWithPrivateParmeterTypes1.prototype.myPublicMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
};
publicClassWithWithPrivateParmeterTypes1.prototype.myPrivateMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
};
return publicClassWithWithPrivateParmeterTypes1;
})();
exports.publicClassWithWithPrivateParmeterTypes1 = publicClassWithWithPrivateParmeterTypes1;
var privateClassWithWithPrivateParmeterTypes = (function () {
function privateClassWithWithPrivateParmeterTypes(param, param1, param2) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
if (param1 === void 0) { param1 = exporter.createExportedWidget1(); }
if (param2 === void 0) { param2 = exporter.createExportedWidget1(); }
this.param1 = param1;
this.param2 = param2;
}
privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
};
privateClassWithWithPrivateParmeterTypes.myPrivateStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
};
privateClassWithWithPrivateParmeterTypes.prototype.myPublicMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
};
privateClassWithWithPrivateParmeterTypes.prototype.myPrivateMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
};
return privateClassWithWithPrivateParmeterTypes;
})();
var privateClassWithWithPrivateParmeterTypes2 = (function () {
function privateClassWithWithPrivateParmeterTypes2(param, param1, param2) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
if (param1 === void 0) { param1 = exporter.createExportedWidget3(); }
if (param2 === void 0) { param2 = exporter.createExportedWidget3(); }
this.param1 = param1;
this.param2 = param2;
}
privateClassWithWithPrivateParmeterTypes2.myPublicStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
};
privateClassWithWithPrivateParmeterTypes2.myPrivateStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
};
privateClassWithWithPrivateParmeterTypes2.prototype.myPublicMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
};
privateClassWithWithPrivateParmeterTypes2.prototype.myPrivateMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
};
return privateClassWithWithPrivateParmeterTypes2;
})();
function publicFunctionWithPrivateParmeterTypes(param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
}
exports.publicFunctionWithPrivateParmeterTypes = publicFunctionWithPrivateParmeterTypes;
function privateFunctionWithPrivateParmeterTypes(param) {
if (param === void 0) { param = exporter.createExportedWidget1(); }
}
function publicFunctionWithPrivateParmeterTypes1(param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
}
exports.publicFunctionWithPrivateParmeterTypes1 = publicFunctionWithPrivateParmeterTypes1;
function privateFunctionWithPrivateParmeterTypes1(param) {
if (param === void 0) { param = exporter.createExportedWidget3(); }
}
var publicClassWithPrivateModuleParameterTypes = (function () {
function publicClassWithPrivateModuleParameterTypes(param, param1, param2) {
if (param === void 0) { param = exporter.createExportedWidget2(); }
if (param1 === void 0) { param1 = exporter.createExportedWidget2(); }
if (param2 === void 0) { param2 = exporter.createExportedWidget2(); }
this.param1 = param1;
this.param2 = param2;
}
publicClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget2(); }
};
publicClassWithPrivateModuleParameterTypes.prototype.myPublicMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget2(); }
};
return publicClassWithPrivateModuleParameterTypes;
})();
exports.publicClassWithPrivateModuleParameterTypes = publicClassWithPrivateModuleParameterTypes;
var publicClassWithPrivateModuleParameterTypes2 = (function () {
function publicClassWithPrivateModuleParameterTypes2(param, param1, param2) {
if (param === void 0) { param = exporter.createExportedWidget4(); }
if (param1 === void 0) { param1 = exporter.createExportedWidget4(); }
if (param2 === void 0) { param2 = exporter.createExportedWidget4(); }
this.param1 = param1;
this.param2 = param2;
}
publicClassWithPrivateModuleParameterTypes2.myPublicStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget4(); }
};
publicClassWithPrivateModuleParameterTypes2.prototype.myPublicMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget4(); }
};
return publicClassWithPrivateModuleParameterTypes2;
})();
exports.publicClassWithPrivateModuleParameterTypes2 = publicClassWithPrivateModuleParameterTypes2;
function publicFunctionWithPrivateModuleParameterTypes(param) {
if (param === void 0) { param = exporter.createExportedWidget2(); }
}
exports.publicFunctionWithPrivateModuleParameterTypes = publicFunctionWithPrivateModuleParameterTypes;
function publicFunctionWithPrivateModuleParameterTypes1(param) {
if (param === void 0) { param = exporter.createExportedWidget4(); }
}
exports.publicFunctionWithPrivateModuleParameterTypes1 = publicFunctionWithPrivateModuleParameterTypes1;
var privateClassWithPrivateModuleParameterTypes = (function () {
function privateClassWithPrivateModuleParameterTypes(param, param1, param2) {
if (param === void 0) { param = exporter.createExportedWidget2(); }
if (param1 === void 0) { param1 = exporter.createExportedWidget2(); }
if (param2 === void 0) { param2 = exporter.createExportedWidget2(); }
this.param1 = param1;
this.param2 = param2;
}
privateClassWithPrivateModuleParameterTypes.myPublicStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget2(); }
};
privateClassWithPrivateModuleParameterTypes.prototype.myPublicMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget2(); }
};
return privateClassWithPrivateModuleParameterTypes;
})();
var privateClassWithPrivateModuleParameterTypes1 = (function () {
function privateClassWithPrivateModuleParameterTypes1(param, param1, param2) {
if (param === void 0) { param = exporter.createExportedWidget4(); }
if (param1 === void 0) { param1 = exporter.createExportedWidget4(); }
if (param2 === void 0) { param2 = exporter.createExportedWidget4(); }
this.param1 = param1;
this.param2 = param2;
}
privateClassWithPrivateModuleParameterTypes1.myPublicStaticMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget4(); }
};
privateClassWithPrivateModuleParameterTypes1.prototype.myPublicMethod = function (param) {
if (param === void 0) { param = exporter.createExportedWidget4(); }
};
return privateClassWithPrivateModuleParameterTypes1;
})();
function privateFunctionWithPrivateModuleParameterTypes(param) {
if (param === void 0) { param = exporter.createExportedWidget2(); }
}
function privateFunctionWithPrivateModuleParameterTypes1(param) {
if (param === void 0) { param = exporter.createExportedWidget4(); }
}
//// [privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.d.ts]
declare module "GlobalWidgets" {
class Widget3 {
name: string;
}
function createWidget3(): Widget3;
module SpecializedGlobalWidget {
class Widget4 {
name: string;
}
function createWidget4(): Widget4;
}
}
//// [privacyFunctionCannotNameParameterTypeDeclFile_Widgets.d.ts]
export declare class Widget1 {
name: string;
}
export declare function createWidget1(): Widget1;
export declare module SpecializedWidget {
class Widget2 {
name: string;
}
function createWidget2(): Widget2;
}
//// [privacyFunctionCannotNameParameterTypeDeclFile_exporter.d.ts]
/// <reference path='privacyFunctionCannotNameParameterTypeDeclFile_GlobalWidgets.d.ts' />
import Widgets = require("privacyFunctionCannotNameParameterTypeDeclFile_Widgets");
import Widgets1 = require("GlobalWidgets");
export declare function createExportedWidget1(): Widgets.Widget1;
export declare function createExportedWidget2(): Widgets.SpecializedWidget.Widget2;
export declare function createExportedWidget3(): Widgets1.Widget3;
export declare function createExportedWidget4(): Widgets1.SpecializedGlobalWidget.Widget4;
@@ -0,0 +1,186 @@
==== tests/cases/compiler/privacyFunctionReturnTypeDeclFile_consumer.ts (12 errors) ====
import exporter = require("privacyFunctionReturnTypeDeclFile_exporter");
export class publicClassWithWithPrivateParmeterTypes {
static myPublicStaticMethod() { // Error
~~~~~~~~~~~~~~~~~~~~
!!! Return type of public static method from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named.
return exporter.createExportedWidget1();
}
private static myPrivateStaticMethod() {
return exporter.createExportedWidget1();;
}
myPublicMethod() { // Error
~~~~~~~~~~~~~~
!!! Return type of public method from exported class has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named.
return exporter.createExportedWidget1();;
}
private myPrivateMethod() {
return exporter.createExportedWidget1();;
}
static myPublicStaticMethod1() { // Error
~~~~~~~~~~~~~~~~~~~~~
!!! Return type of public static method from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
return exporter.createExportedWidget3();
}
private static myPrivateStaticMethod1() {
return exporter.createExportedWidget3();;
}
myPublicMethod1() { // Error
~~~~~~~~~~~~~~~
!!! Return type of public method from exported class has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
return exporter.createExportedWidget3();;
}
private myPrivateMethod1() {
return exporter.createExportedWidget3();;
}
}
class privateClassWithWithPrivateParmeterTypes {
static myPublicStaticMethod() {
return exporter.createExportedWidget1();
}
private static myPrivateStaticMethod() {
return exporter.createExportedWidget1();;
}
myPublicMethod() {
return exporter.createExportedWidget1();;
}
private myPrivateMethod() {
return exporter.createExportedWidget1();;
}
static myPublicStaticMethod1() {
return exporter.createExportedWidget3();
}
private static myPrivateStaticMethod1() {
return exporter.createExportedWidget3();;
}
myPublicMethod1() {
return exporter.createExportedWidget3();;
}
private myPrivateMethod1() {
return exporter.createExportedWidget3();;
}
}
export function publicFunctionWithPrivateParmeterTypes() { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Return type of exported function has or is using name 'Widget1' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named.
return exporter.createExportedWidget1();
}
function privateFunctionWithPrivateParmeterTypes() {
return exporter.createExportedWidget1();
}
export function publicFunctionWithPrivateParmeterTypes1() { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Return type of exported function has or is using name 'Widget3' from external module "GlobalWidgets" but cannot be named.
return exporter.createExportedWidget3();
}
function privateFunctionWithPrivateParmeterTypes1() {
return exporter.createExportedWidget3();
}
export class publicClassWithPrivateModuleReturnTypes {
static myPublicStaticMethod() { // Error
~~~~~~~~~~~~~~~~~~~~
!!! Return type of public static method from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named.
return exporter.createExportedWidget2();
}
myPublicMethod() { // Error
~~~~~~~~~~~~~~
!!! Return type of public method from exported class has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named.
return exporter.createExportedWidget2();
}
static myPublicStaticMethod1() { // Error
~~~~~~~~~~~~~~~~~~~~~
!!! Return type of public static method from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
return exporter.createExportedWidget4();
}
myPublicMethod1() { // Error
~~~~~~~~~~~~~~~
!!! Return type of public method from exported class has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
return exporter.createExportedWidget4();
}
}
export function publicFunctionWithPrivateModuleReturnTypes() { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Return type of exported function has or is using name 'SpecializedWidget.Widget2' from external module "tests/cases/compiler/privacyFunctionReturnTypeDeclFile_Widgets" but cannot be named.
return exporter.createExportedWidget2();
}
export function publicFunctionWithPrivateModuleReturnTypes1() { // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Return type of exported function has or is using name 'SpecializedGlobalWidget.Widget4' from external module "GlobalWidgets" but cannot be named.
return exporter.createExportedWidget4();
}
class privateClassWithPrivateModuleReturnTypes {
static myPublicStaticMethod() {
return exporter.createExportedWidget2();
}
myPublicMethod() {
return exporter.createExportedWidget2();
}
static myPublicStaticMethod1() { // Error
return exporter.createExportedWidget4();
}
myPublicMethod1() { // Error
return exporter.createExportedWidget4();
}
}
function privateFunctionWithPrivateModuleReturnTypes() {
return exporter.createExportedWidget2();
}
function privateFunctionWithPrivateModuleReturnTypes1() {
return exporter.createExportedWidget4();
}
==== tests/cases/compiler/privacyFunctionReturnTypeDeclFile_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/privacyFunctionReturnTypeDeclFile_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/privacyFunctionReturnTypeDeclFile_exporter.ts (0 errors) ====
///<reference path='privacyFunctionReturnTypeDeclFile_GlobalWidgets.ts'/>
import Widgets = require("privacyFunctionReturnTypeDeclFile_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();
}
@@ -0,0 +1,381 @@
//// [tests/cases/compiler/privacyFunctionCannotNameReturnTypeDeclFile.ts] ////
//// [privacyFunctionReturnTypeDeclFile_GlobalWidgets.ts]
declare module "GlobalWidgets" {
export class Widget3 {
name: string;
}
export function createWidget3(): Widget3;
export module SpecializedGlobalWidget {
export class Widget4 {
name: string;
}
function createWidget4(): Widget4;
}
}
//// [privacyFunctionReturnTypeDeclFile_Widgets.ts]
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();
}
}
//// [privacyFunctionReturnTypeDeclFile_exporter.ts]
///<reference path='privacyFunctionReturnTypeDeclFile_GlobalWidgets.ts'/>
import Widgets = require("privacyFunctionReturnTypeDeclFile_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();
}
//// [privacyFunctionReturnTypeDeclFile_consumer.ts]
import exporter = require("privacyFunctionReturnTypeDeclFile_exporter");
export class publicClassWithWithPrivateParmeterTypes {
static myPublicStaticMethod() { // Error
return exporter.createExportedWidget1();
}
private static myPrivateStaticMethod() {
return exporter.createExportedWidget1();;
}
myPublicMethod() { // Error
return exporter.createExportedWidget1();;
}
private myPrivateMethod() {
return exporter.createExportedWidget1();;
}
static myPublicStaticMethod1() { // Error
return exporter.createExportedWidget3();
}
private static myPrivateStaticMethod1() {
return exporter.createExportedWidget3();;
}
myPublicMethod1() { // Error
return exporter.createExportedWidget3();;
}
private myPrivateMethod1() {
return exporter.createExportedWidget3();;
}
}
class privateClassWithWithPrivateParmeterTypes {
static myPublicStaticMethod() {
return exporter.createExportedWidget1();
}
private static myPrivateStaticMethod() {
return exporter.createExportedWidget1();;
}
myPublicMethod() {
return exporter.createExportedWidget1();;
}
private myPrivateMethod() {
return exporter.createExportedWidget1();;
}
static myPublicStaticMethod1() {
return exporter.createExportedWidget3();
}
private static myPrivateStaticMethod1() {
return exporter.createExportedWidget3();;
}
myPublicMethod1() {
return exporter.createExportedWidget3();;
}
private myPrivateMethod1() {
return exporter.createExportedWidget3();;
}
}
export function publicFunctionWithPrivateParmeterTypes() { // Error
return exporter.createExportedWidget1();
}
function privateFunctionWithPrivateParmeterTypes() {
return exporter.createExportedWidget1();
}
export function publicFunctionWithPrivateParmeterTypes1() { // Error
return exporter.createExportedWidget3();
}
function privateFunctionWithPrivateParmeterTypes1() {
return exporter.createExportedWidget3();
}
export class publicClassWithPrivateModuleReturnTypes {
static myPublicStaticMethod() { // Error
return exporter.createExportedWidget2();
}
myPublicMethod() { // Error
return exporter.createExportedWidget2();
}
static myPublicStaticMethod1() { // Error
return exporter.createExportedWidget4();
}
myPublicMethod1() { // Error
return exporter.createExportedWidget4();
}
}
export function publicFunctionWithPrivateModuleReturnTypes() { // Error
return exporter.createExportedWidget2();
}
export function publicFunctionWithPrivateModuleReturnTypes1() { // Error
return exporter.createExportedWidget4();
}
class privateClassWithPrivateModuleReturnTypes {
static myPublicStaticMethod() {
return exporter.createExportedWidget2();
}
myPublicMethod() {
return exporter.createExportedWidget2();
}
static myPublicStaticMethod1() { // Error
return exporter.createExportedWidget4();
}
myPublicMethod1() { // Error
return exporter.createExportedWidget4();
}
}
function privateFunctionWithPrivateModuleReturnTypes() {
return exporter.createExportedWidget2();
}
function privateFunctionWithPrivateModuleReturnTypes1() {
return exporter.createExportedWidget4();
}
//// [privacyFunctionReturnTypeDeclFile_GlobalWidgets.js]
//// [privacyFunctionReturnTypeDeclFile_Widgets.js]
var Widget1 = (function () {
function Widget1() {
this.name = 'one';
}
return Widget1;
})();
exports.Widget1 = Widget1;
function createWidget1() {
return new Widget1();
}
exports.createWidget1 = createWidget1;
(function (SpecializedWidget) {
var Widget2 = (function () {
function Widget2() {
this.name = 'one';
}
return Widget2;
})();
SpecializedWidget.Widget2 = Widget2;
function createWidget2() {
return new Widget2();
}
SpecializedWidget.createWidget2 = createWidget2;
})(exports.SpecializedWidget || (exports.SpecializedWidget = {}));
var SpecializedWidget = exports.SpecializedWidget;
//// [privacyFunctionReturnTypeDeclFile_exporter.js]
var Widgets = require("privacyFunctionReturnTypeDeclFile_Widgets");
var Widgets1 = require("GlobalWidgets");
function createExportedWidget1() {
return Widgets.createWidget1();
}
exports.createExportedWidget1 = createExportedWidget1;
function createExportedWidget2() {
return Widgets.SpecializedWidget.createWidget2();
}
exports.createExportedWidget2 = createExportedWidget2;
function createExportedWidget3() {
return Widgets1.createWidget3();
}
exports.createExportedWidget3 = createExportedWidget3;
function createExportedWidget4() {
return Widgets1.SpecializedGlobalWidget.createWidget4();
}
exports.createExportedWidget4 = createExportedWidget4;
//// [privacyFunctionReturnTypeDeclFile_consumer.js]
var exporter = require("privacyFunctionReturnTypeDeclFile_exporter");
var publicClassWithWithPrivateParmeterTypes = (function () {
function publicClassWithWithPrivateParmeterTypes() {
}
publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () {
return exporter.createExportedWidget1();
};
publicClassWithWithPrivateParmeterTypes.myPrivateStaticMethod = function () {
return exporter.createExportedWidget1();
;
};
publicClassWithWithPrivateParmeterTypes.prototype.myPublicMethod = function () {
return exporter.createExportedWidget1();
;
};
publicClassWithWithPrivateParmeterTypes.prototype.myPrivateMethod = function () {
return exporter.createExportedWidget1();
;
};
publicClassWithWithPrivateParmeterTypes.myPublicStaticMethod1 = function () {
return exporter.createExportedWidget3();
};
publicClassWithWithPrivateParmeterTypes.myPrivateStaticMethod1 = function () {
return exporter.createExportedWidget3();
;
};
publicClassWithWithPrivateParmeterTypes.prototype.myPublicMethod1 = function () {
return exporter.createExportedWidget3();
;
};
publicClassWithWithPrivateParmeterTypes.prototype.myPrivateMethod1 = function () {
return exporter.createExportedWidget3();
;
};
return publicClassWithWithPrivateParmeterTypes;
})();
exports.publicClassWithWithPrivateParmeterTypes = publicClassWithWithPrivateParmeterTypes;
var privateClassWithWithPrivateParmeterTypes = (function () {
function privateClassWithWithPrivateParmeterTypes() {
}
privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod = function () {
return exporter.createExportedWidget1();
};
privateClassWithWithPrivateParmeterTypes.myPrivateStaticMethod = function () {
return exporter.createExportedWidget1();
;
};
privateClassWithWithPrivateParmeterTypes.prototype.myPublicMethod = function () {
return exporter.createExportedWidget1();
;
};
privateClassWithWithPrivateParmeterTypes.prototype.myPrivateMethod = function () {
return exporter.createExportedWidget1();
;
};
privateClassWithWithPrivateParmeterTypes.myPublicStaticMethod1 = function () {
return exporter.createExportedWidget3();
};
privateClassWithWithPrivateParmeterTypes.myPrivateStaticMethod1 = function () {
return exporter.createExportedWidget3();
;
};
privateClassWithWithPrivateParmeterTypes.prototype.myPublicMethod1 = function () {
return exporter.createExportedWidget3();
;
};
privateClassWithWithPrivateParmeterTypes.prototype.myPrivateMethod1 = function () {
return exporter.createExportedWidget3();
;
};
return privateClassWithWithPrivateParmeterTypes;
})();
function publicFunctionWithPrivateParmeterTypes() {
return exporter.createExportedWidget1();
}
exports.publicFunctionWithPrivateParmeterTypes = publicFunctionWithPrivateParmeterTypes;
function privateFunctionWithPrivateParmeterTypes() {
return exporter.createExportedWidget1();
}
function publicFunctionWithPrivateParmeterTypes1() {
return exporter.createExportedWidget3();
}
exports.publicFunctionWithPrivateParmeterTypes1 = publicFunctionWithPrivateParmeterTypes1;
function privateFunctionWithPrivateParmeterTypes1() {
return exporter.createExportedWidget3();
}
var publicClassWithPrivateModuleReturnTypes = (function () {
function publicClassWithPrivateModuleReturnTypes() {
}
publicClassWithPrivateModuleReturnTypes.myPublicStaticMethod = function () {
return exporter.createExportedWidget2();
};
publicClassWithPrivateModuleReturnTypes.prototype.myPublicMethod = function () {
return exporter.createExportedWidget2();
};
publicClassWithPrivateModuleReturnTypes.myPublicStaticMethod1 = function () {
return exporter.createExportedWidget4();
};
publicClassWithPrivateModuleReturnTypes.prototype.myPublicMethod1 = function () {
return exporter.createExportedWidget4();
};
return publicClassWithPrivateModuleReturnTypes;
})();
exports.publicClassWithPrivateModuleReturnTypes = publicClassWithPrivateModuleReturnTypes;
function publicFunctionWithPrivateModuleReturnTypes() {
return exporter.createExportedWidget2();
}
exports.publicFunctionWithPrivateModuleReturnTypes = publicFunctionWithPrivateModuleReturnTypes;
function publicFunctionWithPrivateModuleReturnTypes1() {
return exporter.createExportedWidget4();
}
exports.publicFunctionWithPrivateModuleReturnTypes1 = publicFunctionWithPrivateModuleReturnTypes1;
var privateClassWithPrivateModuleReturnTypes = (function () {
function privateClassWithPrivateModuleReturnTypes() {
}
privateClassWithPrivateModuleReturnTypes.myPublicStaticMethod = function () {
return exporter.createExportedWidget2();
};
privateClassWithPrivateModuleReturnTypes.prototype.myPublicMethod = function () {
return exporter.createExportedWidget2();
};
privateClassWithPrivateModuleReturnTypes.myPublicStaticMethod1 = function () {
return exporter.createExportedWidget4();
};
privateClassWithPrivateModuleReturnTypes.prototype.myPublicMethod1 = function () {
return exporter.createExportedWidget4();
};
return privateClassWithPrivateModuleReturnTypes;
})();
function privateFunctionWithPrivateModuleReturnTypes() {
return exporter.createExportedWidget2();
}
function privateFunctionWithPrivateModuleReturnTypes1() {
return exporter.createExportedWidget4();
}
//// [privacyFunctionReturnTypeDeclFile_GlobalWidgets.d.ts]
declare module "GlobalWidgets" {
class Widget3 {
name: string;
}
function createWidget3(): Widget3;
module SpecializedGlobalWidget {
class Widget4 {
name: string;
}
function createWidget4(): Widget4;
}
}
//// [privacyFunctionReturnTypeDeclFile_Widgets.d.ts]
export declare class Widget1 {
name: string;
}
export declare function createWidget1(): Widget1;
export declare module SpecializedWidget {
class Widget2 {
name: string;
}
function createWidget2(): Widget2;
}
//// [privacyFunctionReturnTypeDeclFile_exporter.d.ts]
/// <reference path='privacyFunctionReturnTypeDeclFile_GlobalWidgets.d.ts' />
import Widgets = require("privacyFunctionReturnTypeDeclFile_Widgets");
import Widgets1 = require("GlobalWidgets");
export declare function createExportedWidget1(): Widgets.Widget1;
export declare function createExportedWidget2(): Widgets.SpecializedWidget.Widget2;
export declare function createExportedWidget3(): Widgets1.Widget3;
export declare function createExportedWidget4(): Widgets1.SpecializedGlobalWidget.Widget4;

Some files were not shown because too many files have changed in this diff Show More