mattpocock / ts-error-translator

VSCode extension to turn TypeScript errors into plain English
https://ts-error-translator.vercel.app
2.35k stars 90 forks source link

Translation request for 2536 #290

Open dugip opened 2 months ago

dugip commented 2 months ago

Error Text

Type 'Extract<keyof TEntity, string>' cannot be used to index type 'this'.

Supporting Information

Please provide other information which led to this error, and any specific questions you have about it:

Sample code that causes this:

export class ComputedEntity<TEntity extends Record<string, any>> {
  constructor(protected schema: TEntity) {
    for (const prop in schema) {
      this[prop] = schema[prop];
    }
  }
}