2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/compiler/moduleVisibilityTest2.ts(57,17): error TS2304: Cannot find name 'x'.
|
|
|
|
tests/cases/compiler/moduleVisibilityTest2.ts(58,21): error TS2339: Property 'E' does not exist on type 'typeof M'.
|
|
|
|
tests/cases/compiler/moduleVisibilityTest2.ts(61,14): error TS2305: Module 'M' has no exported member 'I'.
|
|
|
|
tests/cases/compiler/moduleVisibilityTest2.ts(61,21): error TS2305: Module 'M' has no exported member 'I'.
|
|
|
|
tests/cases/compiler/moduleVisibilityTest2.ts(64,11): error TS2339: Property 'x' does not exist on type 'typeof M'.
|
|
|
|
tests/cases/compiler/moduleVisibilityTest2.ts(65,15): error TS2339: Property 'E' does not exist on type 'typeof M'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/moduleVisibilityTest2.ts (6 errors) ====
|
|
|
|
|
|
|
|
|
|
|
|
module OuterMod {
|
|
|
|
export function someExportedOuterFunc() { return -1; }
|
|
|
|
|
|
|
|
export module OuterInnerMod {
|
|
|
|
export function someExportedOuterInnerFunc() { return "foo"; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
import OuterInnerAlias = OuterMod.OuterInnerMod;
|
|
|
|
|
|
|
|
module M {
|
|
|
|
|
|
|
|
module InnerMod {
|
|
|
|
export function someExportedInnerFunc() { return -2; }
|
|
|
|
}
|
|
|
|
|
|
|
|
enum E {
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
C,
|
|
|
|
}
|
|
|
|
|
|
|
|
var x = 5;
|
|
|
|
export declare var exported_var;
|
|
|
|
|
|
|
|
var y = x + x;
|
|
|
|
|
|
|
|
|
|
|
|
interface I {
|
|
|
|
someMethod():number;
|
|
|
|
}
|
|
|
|
|
|
|
|
class B {public b = 0;}
|
|
|
|
|
|
|
|
export class C implements I {
|
|
|
|
public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();}
|
|
|
|
public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();}
|
|
|
|
public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();}
|
|
|
|
public someMethod() { return 0; }
|
|
|
|
public someProp = 1;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
function someInnerFunc() { return 2; }
|
|
|
|
var someInnerVar = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var someModuleVar = 4;
|
|
|
|
|
|
|
|
function someModuleFunction() { return 5;}
|
|
|
|
}
|
|
|
|
|
|
|
|
module M {
|
|
|
|
export var c = x;
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2304: Cannot find name 'x'.
|
2014-07-13 01:04:16 +02:00
|
|
|
export var meb = M.E.B;
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2339: Property 'E' does not exist on type 'typeof M'.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var cprime : M.I = <M.I>null;
|
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2305: Module 'M' has no exported member 'I'.
|
2014-07-13 01:04:16 +02:00
|
|
|
~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2305: Module 'M' has no exported member 'I'.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
var c = new M.C();
|
|
|
|
var z = M.x;
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2339: Property 'x' does not exist on type 'typeof M'.
|
2014-07-13 01:04:16 +02:00
|
|
|
var alpha = M.E.A;
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2339: Property 'E' does not exist on type 'typeof M'.
|
2014-07-13 01:04:16 +02:00
|
|
|
var omega = M.exported_var;
|
|
|
|
c.someMethodThatCallsAnOuterMethod();
|
|
|
|
|