mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Address CR feedback
This commit is contained in:
@@ -15,7 +15,7 @@ tests/cases/compiler/indexSignatureAndMappedType.ts(16,5): error TS2322: Type '{
|
||||
!!! error TS2322: Type '{ [key: string]: T; }' is not assignable to type 'Record<K, T>'.
|
||||
}
|
||||
|
||||
function f2<T, K extends string>(x: { [key: string]: T }, y: Record<string, T>) {
|
||||
function f2<T>(x: { [key: string]: T }, y: Record<string, T>) {
|
||||
x = y;
|
||||
y = x;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ function f1<T, K extends string>(x: { [key: string]: T }, y: Record<K, T>) {
|
||||
y = x; // Error
|
||||
}
|
||||
|
||||
function f2<T, K extends string>(x: { [key: string]: T }, y: Record<string, T>) {
|
||||
function f2<T>(x: { [key: string]: T }, y: Record<string, T>) {
|
||||
x = y;
|
||||
y = x;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ function f3(x, y) {
|
||||
declare function f1<T, K extends string>(x: {
|
||||
[key: string]: T;
|
||||
}, y: Record<K, T>): void;
|
||||
declare function f2<T, K extends string>(x: {
|
||||
declare function f2<T>(x: {
|
||||
[key: string]: T;
|
||||
}, y: Record<string, T>): void;
|
||||
declare function f3<T, U, K extends string>(x: {
|
||||
|
||||
@@ -9,7 +9,7 @@ function f1<T, K extends string>(x: { [key: string]: T }, y: Record<K, T>) {
|
||||
y = x; // Error
|
||||
}
|
||||
|
||||
function f2<T, K extends string>(x: { [key: string]: T }, y: Record<string, T>) {
|
||||
function f2<T>(x: { [key: string]: T }, y: Record<string, T>) {
|
||||
x = y;
|
||||
y = x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user