2014-07-25 01:44:52 +02:00
|
|
|
==== tests/cases/compiler/duplicateSymbolsExportMatching.ts (18 errors) ====
|
2014-07-13 01:04:16 +02:00
|
|
|
module M {
|
|
|
|
export interface E { }
|
|
|
|
interface I { }
|
|
|
|
}
|
|
|
|
module M {
|
|
|
|
export interface E { } // ok
|
|
|
|
interface I { } // ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// Doesn't match export visibility, but it's in a different parent, so it's ok
|
|
|
|
module M {
|
|
|
|
interface E { } // ok
|
|
|
|
export interface I { } // ok
|
|
|
|
}
|
|
|
|
|
|
|
|
module N {
|
|
|
|
interface I { }
|
|
|
|
interface I { } // ok
|
|
|
|
export interface E { }
|
|
|
|
export interface E { } // ok
|
|
|
|
}
|
|
|
|
|
|
|
|
module N2 {
|
|
|
|
interface I { }
|
2014-07-25 01:44:52 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration I must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
export interface I { } // error
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration I must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
export interface E { }
|
2014-07-25 01:44:52 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration E must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
interface E { } // error
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration E must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Should report error only once for instantiated module
|
|
|
|
module M {
|
|
|
|
module inst {
|
2014-07-25 01:44:52 +02:00
|
|
|
~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration inst must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
var t;
|
|
|
|
}
|
|
|
|
export module inst { // one error
|
|
|
|
~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration inst must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
var t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Variables of the same / different type
|
|
|
|
module M2 {
|
|
|
|
var v: string;
|
2014-07-25 01:44:52 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration v must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
export var v: string; // one error (visibility)
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration v must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
var w: number;
|
2014-07-25 01:44:52 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration w must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
export var w: string; // two errors (visibility and type mismatch)
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration w must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module M {
|
|
|
|
module F {
|
2014-07-22 21:09:25 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration F must be all exported or all local.
|
2014-08-19 00:35:37 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2434: A module declaration cannot be located prior to a class or function with which it is merged
|
2014-07-13 01:04:16 +02:00
|
|
|
var t;
|
|
|
|
}
|
|
|
|
export function F() { } // Only one error for duplicate identifier (don't consider visibility)
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration F must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module M {
|
|
|
|
class C { }
|
2014-07-25 01:44:52 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
module C { }
|
2014-07-25 01:44:52 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
export module C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol)
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration C must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
var t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Top level
|
|
|
|
interface D { }
|
2014-07-25 01:44:52 +02:00
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration D must be all exported or all local.
|
2014-07-13 01:04:16 +02:00
|
|
|
export interface D { }
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2395: Individual declarations in merged declaration D must be all exported or all local.
|