mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
144 lines
5.5 KiB
Plaintext
144 lines
5.5 KiB
Plaintext
enumAssignmentCompat3.ts(68,1): error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'.
|
|
Property 'd' is missing in type 'First.E'.
|
|
enumAssignmentCompat3.ts(70,1): error TS2322: Type 'Cd.E' is not assignable to type 'First.E'.
|
|
Each declaration of 'E.c' differs in its value, where '2' was expected but '0' was given.
|
|
enumAssignmentCompat3.ts(71,1): error TS2322: Type 'Nope' is not assignable to type 'E'.
|
|
enumAssignmentCompat3.ts(72,1): error TS2322: Type 'Decl.E' is not assignable to type 'First.E'.
|
|
Each declaration of 'E.c' differs in its value, where '2' was expected but '3' was given.
|
|
enumAssignmentCompat3.ts(75,1): error TS2322: Type 'First.E' is not assignable to type 'Ab.E'.
|
|
Property 'c' is missing in type 'Ab.E'.
|
|
enumAssignmentCompat3.ts(76,1): error TS2322: Type 'First.E' is not assignable to type 'Cd.E'.
|
|
Property 'a' is missing in type 'Cd.E'.
|
|
enumAssignmentCompat3.ts(77,1): error TS2322: Type 'E' is not assignable to type 'Nope'.
|
|
enumAssignmentCompat3.ts(78,1): error TS2322: Type 'First.E' is not assignable to type 'Decl.E'.
|
|
Each declaration of 'E.c' differs in its value, where '3' was expected but '2' was given.
|
|
enumAssignmentCompat3.ts(82,1): error TS2322: Type 'Const.E' is not assignable to type 'First.E'.
|
|
enumAssignmentCompat3.ts(83,1): error TS2322: Type 'First.E' is not assignable to type 'Const.E'.
|
|
enumAssignmentCompat3.ts(86,1): error TS2322: Type 'Merged.E' is not assignable to type 'First.E'.
|
|
Each declaration of 'E.c' differs in its value, where '2' was expected but '3' was given.
|
|
enumAssignmentCompat3.ts(87,1): error TS2322: Type 'First.E' is not assignable to type 'Merged.E'.
|
|
Each declaration of 'E.c' differs in its value, where '3' was expected but '2' was given.
|
|
|
|
|
|
==== enumAssignmentCompat3.ts (12 errors) ====
|
|
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,
|
|
}
|
|
}
|
|
namespace Const {
|
|
export const enum E {
|
|
a, b, c,
|
|
}
|
|
}
|
|
namespace Decl {
|
|
export declare enum E {
|
|
a, b, c = 3,
|
|
}
|
|
}
|
|
namespace Merged {
|
|
export enum E {
|
|
a, b,
|
|
}
|
|
export enum E {
|
|
c = 3, d,
|
|
}
|
|
}
|
|
|
|
namespace Merged2 {
|
|
export enum E {
|
|
a, b, c
|
|
}
|
|
export namespace E {
|
|
export let d = 5;
|
|
}
|
|
}
|
|
|
|
declare var abc: First.E;
|
|
declare var secondAbc: Abc.E;
|
|
declare var secondAbcd: Abcd.E;
|
|
declare var secondAb: Ab.E;
|
|
declare var secondCd: Cd.E;
|
|
declare var nope: Abc.Nope;
|
|
declare var k: Const.E;
|
|
declare var decl: Decl.E;
|
|
declare var merged: Merged.E;
|
|
declare var merged2: Merged2.E;
|
|
abc = secondAbc; // ok
|
|
abc = secondAbcd; // missing 'd'
|
|
~~~
|
|
!!! error TS2322: Type 'Abcd.E' is not assignable to type 'First.E'.
|
|
!!! error TS2322: Property 'd' is missing in type 'First.E'.
|
|
abc = secondAb; // ok
|
|
abc = secondCd; // missing 'd'
|
|
~~~
|
|
!!! error TS2322: Type 'Cd.E' is not assignable to type 'First.E'.
|
|
!!! error TS2322: Each declaration of 'E.c' differs in its value, where '2' was expected but '0' was given.
|
|
abc = nope; // nope!
|
|
~~~
|
|
!!! error TS2322: Type 'Nope' is not assignable to type 'E'.
|
|
abc = decl; // bad - value of 'c' differs between these enums
|
|
~~~
|
|
!!! error TS2322: Type 'Decl.E' is not assignable to type 'First.E'.
|
|
!!! error TS2322: Each declaration of 'E.c' differs in its value, where '2' was expected but '3' was given.
|
|
secondAbc = abc; // ok
|
|
secondAbcd = abc; // ok
|
|
secondAb = abc; // missing 'c'
|
|
~~~~~~~~
|
|
!!! error TS2322: Type 'First.E' is not assignable to type 'Ab.E'.
|
|
!!! error TS2322: Property 'c' is missing in type 'Ab.E'.
|
|
secondCd = abc; // missing 'a' and 'b'
|
|
~~~~~~~~
|
|
!!! error TS2322: Type 'First.E' is not assignable to type 'Cd.E'.
|
|
!!! error TS2322: Property 'a' is missing in type 'Cd.E'.
|
|
nope = abc; // nope!
|
|
~~~~
|
|
!!! error TS2322: Type 'E' is not assignable to type 'Nope'.
|
|
decl = abc; // bad - value of 'c' differs between these enums
|
|
~~~~
|
|
!!! error TS2322: Type 'First.E' is not assignable to type 'Decl.E'.
|
|
!!! error TS2322: Each declaration of 'E.c' differs in its value, where '3' was expected but '2' was given.
|
|
|
|
// const is only assignable to itself
|
|
k = k;
|
|
abc = k; // error
|
|
~~~
|
|
!!! error TS2322: Type 'Const.E' is not assignable to type 'First.E'.
|
|
k = abc;
|
|
~
|
|
!!! error TS2322: Type 'First.E' is not assignable to type 'Const.E'.
|
|
|
|
// merged enums compare all their members
|
|
abc = merged; // missing 'd'
|
|
~~~
|
|
!!! error TS2322: Type 'Merged.E' is not assignable to type 'First.E'.
|
|
!!! error TS2322: Each declaration of 'E.c' differs in its value, where '2' was expected but '3' was given.
|
|
merged = abc; // bad - value of 'c' differs between these enums
|
|
~~~~~~
|
|
!!! error TS2322: Type 'First.E' is not assignable to type 'Merged.E'.
|
|
!!! error TS2322: Each declaration of 'E.c' differs in its value, where '3' was expected but '2' was given.
|
|
abc = merged2; // ok
|
|
merged2 = abc; // ok |