Value declared with interface not assignable to Record<string, unknown>
#60677
Labels
Duplicate
An existing issue was already created
Record<string, unknown>
#60677
🔎 Search Terms
"T extends Record<string, unknown>", "interface extends Record<string, unknown>", "interface not assignable to
Record<string, unknown>
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.7.2&ssl=8&ssc=38&pln=8&pc=1#code/PTAEBUFMGcBcEsB2BzUsDuB7U8AmlEEBjAQwBtRoALEgBxgC5QBZAT3FftBMVxdYCShSACcAZiSKQAULE6R+HLgF5QAb1BjMmJgCNtZSD1ABfaUliiJU-kMvjJCjVp2h9mQ8bPSQEGLG5oaHhkRCRUWGwAJUgiTBFcAB44EXCAGlAAV0QAa0RMdEQAPmk4xDhuJjY7K0dQVWdtJlgRTIUTAG4fMAAxEngyaCYlBQByauEHKVGcaFB8gJIgkMQSXUM0bDkuUZi4hOSW9Kzc-MKi0dLMcoDdJj34pJTj7LyC4vruLqub0CIq9jyT6NVwtNqmLplCq4e6xR6HVIoDKvM4fVREb6+KBwcIQUCQAAell4cweB2eSJOb3OsiBAmgZNwAGUjigAKqnd6JcBFT7gfFEgi4Ulw8ms5DIznnUAAflAo1YMBmTFG+VGkOuFUgTHpjJZiOQHOpiESbBGvNUCqVXV8AEE5iRQCIYJkyLAMhN7NYFLhMDB5pgAoTiXxGQiXlLij8KmIdQzRczxUbUabBJNvRb5WrvtJc7nfMpC4XQLbcLh4AhruQ0P45rpIGQCvUi8powFkHoDEZEAKQ3MUe9ZfLFdBlVnMDNLSP1W3QFQATUppAANqjFyjAC6vaF-cjQ6to9AKrVnwPM+6fhxKDxwZ3oDDFIl3EQrBK2wUuoT+vCtpf3Mz-K3iS94JuGlI8K++7Tke44zlCATwHGerir+rCpuap7ThqvwAFZIV+KF-p6tRSJmZ4dEAA
💻 Code
🙁 Actual behavior
MyInterface
is not assignable to typeRecord<string, unknown>
MyInterface
does not extendRecord<string, unknown>
.🙂 Expected behavior
MyInterface
is assignable toRecord<string, unknown>
, so the following code should compile:const a: MyInterface = { foo: true };
const b: Record<string, unknown> = a;
MyInterface
extendsRecord<string, unknown>
, so the following code should compile:const d: IsRecordStringUnknown<MyInterface> = 'yes';
Additional information about the issue
The most relevant documentation I could find related to this:
source
The text was updated successfully, but these errors were encountered: