ts-error-translator icon indicating copy to clipboard operation
ts-error-translator copied to clipboard

Translation request for 2536

Open dugip opened this issue 10 months ago • 0 comments

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];
    }
  }
}

dugip avatar Apr 22 '24 18:04 dugip