46 lines
787 B
TypeScript
46 lines
787 B
TypeScript
|
namespace First {
|
||
|
export enum E {
|
||
|
a, b, c,
|
||
|
}
|
||
|
}
|
||
|
namespace Abc {
|
||
|
export enum E {
|
||
|
a, b, c,
|
||
|
}
|
||
|
export enum Nope {
|
||
|
a, b, c,
|
||
|
}
|
||
|
}
|
||
|
namespace Abcd {
|
||
|
export enum E {
|
||
|
a, b, c, d,
|
||
|
}
|
||
|
}
|
||
|
namespace Ab {
|
||
|
export enum E {
|
||
|
a, b,
|
||
|
}
|
||
|
}
|
||
|
namespace Cd {
|
||
|
export enum E {
|
||
|
c, d,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
var abc: First.E;
|
||
|
var secondAbc: Abc.E;
|
||
|
var secondAbcd: Abcd.E;
|
||
|
var secondAb: Ab.E;
|
||
|
var secondCd: Cd.E;
|
||
|
var nope: Abc.Nope;
|
||
|
abc = secondAbc; // ok
|
||
|
abc = secondAbcd; // missing 'd'
|
||
|
abc = secondAb; // ok
|
||
|
abc = secondCd; // missing 'd'
|
||
|
abc = nope; // nope!
|
||
|
secondAbc = abc; // ok
|
||
|
secondAbcd = abc; // ok
|
||
|
secondAb = abc; // missing 'c'
|
||
|
secondCd = abc; // missing 'a' and 'b'
|
||
|
nope = abc; // nope!
|