mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Add regression test
This commit is contained in:
@@ -57,4 +57,49 @@ function getValueAsString(value: IntersectionFail): string {
|
||||
return '' + value.num;
|
||||
}
|
||||
return value.str;
|
||||
}
|
||||
|
||||
// Repro from #12535
|
||||
|
||||
namespace enums {
|
||||
export const enum A {
|
||||
a1,
|
||||
a2,
|
||||
a3,
|
||||
// ... elements omitted for the sake of clarity
|
||||
a75,
|
||||
a76,
|
||||
a77,
|
||||
}
|
||||
export const enum B {
|
||||
b1,
|
||||
b2,
|
||||
// ... elements omitted for the sake of clarity
|
||||
b86,
|
||||
b87,
|
||||
}
|
||||
export const enum C {
|
||||
c1,
|
||||
c2,
|
||||
// ... elements omitted for the sake of clarity
|
||||
c210,
|
||||
c211,
|
||||
}
|
||||
export type Genre = A | B | C;
|
||||
}
|
||||
|
||||
type Foo = {
|
||||
genreId: enums.Genre;
|
||||
};
|
||||
|
||||
type Bar = {
|
||||
genreId: enums.Genre;
|
||||
};
|
||||
|
||||
type FooBar = Foo & Bar;
|
||||
|
||||
function foo(so: any) {
|
||||
const val = so as FooBar;
|
||||
const isGenre = val.genreId;
|
||||
return isGenre;
|
||||
}
|
||||
Reference in New Issue
Block a user