Closed as not planned
Description
π Search Terms
Generic constraints
template literals
π Version & Regression Information
5.1.6
β― Playground Link
π» Code
type templateLiteralObject = Record< `${string}_${string}`,any> // or { [k : `${string}_${string}`]: any }
const test0 = {aaa:123} satisfies templateLiteralObject // error: Type '{ aaa: number; }' does not satisfy the expected type 'templateLiteral'.The error is as expected .
type foo<T extends templateLiteralObject> = T
type test1 = foo<{aaa:123}> // Hope this is an error. Because test0 will report an error
type test2 = {aaa:123} extends templateLiteralObject ? true : false // also should be false,Currently is true
π Actual behavior
test0 throw errorοΌ Type '{ aaa: number; }' does not satisfy the expected type 'templateLiteral'.
but test1 No error reported
π Expected behavior
Hope test1 reported an error
Additional information about the issue
No response