TypeScript/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.errors.txt

56 lines
2 KiB
Plaintext

tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(10,23): error TS4025: Exported variable 'p' has or is using private name 'W'.
tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(33,22): error TS4081: Exported type alias 't2' has or is using private name 'private1'.
tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(36,23): error TS4081: Exported type alias 't12' has or is using private name 'public1'.
tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts(39,24): error TS4081: Exported type alias 't112' has or is using private name 'm3'.
==== tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts (4 errors) ====
interface Window {
someMethod();
}
module M {
type W = Window | string;
export module N {
export class Window { }
export var p: W; // Should report error that W is private
~
!!! error TS4025: Exported variable 'p' has or is using private name 'W'.
}
}
module M1 {
export type W = Window | string;
export module N {
export class Window { }
export var p: W; // No error
}
}
module M2 {
class private1 {
}
class public1 {
}
module m3 {
export class public1 {
}
}
type t1 = private1;
export type t2 = private1; // error
~~~~~~~~
!!! error TS4081: Exported type alias 't2' has or is using private name 'private1'.
type t11 = public1;
export type t12 = public1;
~~~~~~~
!!! error TS4081: Exported type alias 't12' has or is using private name 'public1'.
type t111 = m3.public1;
export type t112 = m3.public1; // error
~~
!!! error TS4081: Exported type alias 't112' has or is using private name 'm3'.
}