mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Add test case and accept baseline
This commit is contained in:
45
tests/cases/compiler/enumAssignmentCompat3.ts
Normal file
45
tests/cases/compiler/enumAssignmentCompat3.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
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!
|
||||
Reference in New Issue
Block a user