ts-error-translator
ts-error-translator copied to clipboard
Translation request for 2536
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];
}
}
}