Closed
Description
Bug Report
typescript: 4.4.3
💻 Code
interface Config {
field: string
}
type GetFieldType<T extends Config = Config> = T extends Config
? true
: false
const test1: GetFieldType = true // => ok
function testFunc<T extends Config>() {
const test2: GetFieldType<T> = true // ts 2322
const test3: GetFieldType<T> = false // ts 2322
}
test1
works well.
But in the generic function, T inherits from Config, but ts cannot infer the type