tannerntannern / ts-mixer

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

hasMixin doesn't work with abstract classes #56

Closed tinkerborg closed 1 year ago

tinkerborg commented 1 year ago

I am trying to test for the presence of an abstract mixin class and am getting a ts2345 error:

Argument of type 'typeof HasMixinTest' is not assignable to parameter of type 'new (...args: any[]) => HasMixinTest'.
  Cannot assign an abstract constructor type to a non-abstract constructor type.ts(2345)

Example code to reproduce this issue:

import { hasMixin, Mixin } from 'ts-mixer'

abstract class HasMixinTest {}

abstract class Foo extends Mixin(HasMixinTest) {}

hasMixin(Foo, HasMixinTest)