Skip to content

Relations based on variance markers do not take into account parameters used as key types. #29698

Description

TypeScript Version: 3.3

Code

typeRecord2<Kextendskeyofany,T>={[PinK]: T;};functiondefaultRecord(x: Record<'a',string>,y: Record<string,string>){x=y;// no error, but error expected.}functioncustomRecord(x: Record2<'a',string>,y: Record2<string,string>){x=y;// no error, but error expected.}functionmixed1(x: Record2<'a',string>,y: Record<string,string>){x=y;// error}functionmixed2(x: Record<'a',string>,y: Record2<string,string>){x=y;// error}

Playground Link:link

Related Issues:#28798

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions