1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
=== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts ===
interface Window {
someMethod();
>someMethod : () => any
}
module M {
>M : typeof M
type W = Window | string;
>W : W
export module N {
>N : typeof N
export class Window { }
>Window : Window
export var p: W; // Should report error that W is private
>p : W
}
}
module M1 {
>M1 : typeof M1
export type W = Window | string;
>W : string | Window
export module N {
>N : typeof N
export class Window { }
>Window : Window
export var p: W; // No error
>p : string | Window
}
}
module M2 {
>M2 : typeof M2
class private1 {
>private1 : private1
}
class public1 {
>public1 : public1
}
module m3 {
>m3 : typeof m3
export class public1 {
>public1 : public1
}
}
type t1 = private1;
>t1 : private1
export type t2 = private1; // error
>t2 : private1
type t11 = public1;
>t11 : public1
export type t12 = public1;
>t12 : public1
type t111 = m3.public1;
>t111 : m3.public1
>m3 : any
export type t112 = m3.public1; // error
>t112 : m3.public1
>m3 : any
}
|