Closed
Description
TypeScript Version: nightly (2.2.0-dev.20161201)
Code
interface X<T extends string, U> {
type: T
data: U
}
type Y = X<'a', { a: string }>
type Z = X<'b', { b: string }>
type YZ = Y | Z
const y: YZ = {
type: 'a',
data: {}
}
Expected behavior:
Error message to show the union type, or at least the best partial match (type Y)
Actual behavior:
Error says the value of y does not match type Z.