tannerntannern / ts-mixer

A small TypeScript library that provides tolerable Mixin functionality.
MIT License
384 stars 27 forks source link

Sometimes constructor does not see elements from default init function. #25

Closed Judahh closed 4 years ago

Judahh commented 4 years ago

abstract class ClassA { protected object0: Class0; protected name; protected test;

init(test: string, object0?: Class0): void { this.name = this.constructor.name; this.test = test; this.object0 = object0 ? object0 : new Class0(); }

getName(): string { return this.name; }

getTest(): string { return this.name; } }

class ClassB extends ClassA { protected name1; init(test: string, object0?: Class0): void { super.init(test, object0); this.name1 = this.name + 1; }

getName1(): string { return this.name1; } }

const b = new ClassB('BB'); // Not possible

tannerntannern commented 4 years ago

Hi @Judahh, these sound like separate problems to me, so probably best to have a separate github issue for each. But either way I will need more details to reproduce.

tannerntannern commented 4 years ago

🤔 I'm failing to see how this relates to ts-mixer, as I don't see any usage of @mix or Mixin. Could you please clarify your issue?

tannerntannern commented 4 years ago

Hi @Judahh, I haven't heard back I'm not seeing a connection to ts-mixer here. Please open another issue if you still think there's a ts-mixer-related issue here.