Repository: TypeScript
Issue: Allow mixin constructor have parameters before rest parameter
Labels: Suggestion,Awaiting More Feedback

## Search Terms
mixin, constructor parameters

## Suggestion
Allow mixin constructor have parameters before rest parameter and infer the combination between mixin parameters.

## Use Cases
The following js code is completely valid and functional. However with the actual mixin constructor constraints we can't reproduce this in Typescript.
```js
const mixin1 = (base) => class Mixin1 extends base {
    constructor(m1v1, m1v2, ...args) {
        super(...args);
        this.m1v1 = m1v1;
        this.m1v2 = m1v2;
    }
};
const mixin2 = (base) => class Mixin2 extends base {
    constructor(m2v1, m2v2, ...args) {
        super(...args);
        this.m2v1 = m2v1;
        this.m2v2 = m2v2;
    }
};
class Base {
    constructor(v1, v2) {
        this.v1 = v1;
        this.v2 = v2;
    }
}
class C1 extends mixin1(Base) {
}
class C2 extends mixin2(Base) {
}
class C3 extends mixin2(mixin1(Base)) {
}
console.log(new C1("m1v1", true, 1, {}));
console.log(new C2(false, 2, 1, {}));
console.log(new C3(false, 2, "m1v1", true, 1, {}));
```

## Examples
Same code expected work in ts with constructor inference.
```ts
type Constructor = new (...args: any[]) => object;

const mixin1 = <T extends Constructor>(base: T) =>
    class Mixin1 extends base {
        m1v1: string;
        m1v2: boolean;

        constructor(m1v1: string, m1v2: boolean, ...args: any[]) {
            super(...args);

            this.m1v1 = m1v1;
            this.m1v2 = m1v2;
        }
    }

const mixin2 = <T extends Constructor>(base: T) =>
    class Mixin2 extends base {
        m2v1: boolean;
        m2v2: number;

        constructor(m2v1: boolean, m2v2: number, ...args: any[]) {
            super(...args);

            this.m2v1 = m2v1;
            this.m2v2 = m2v2;
        }
    }

class Base {
    v1: number;
    v2: object;

    constructor(v1: number, v2: object) {
        this.v1 = v1;
        this.v2 = v2;
    }
}

class C1 extends mixin1(Base) {
}

class C2 extends mixin2(Base) {
}

class C3 extends mixin2(mixin1(Base)) {
}

console.log(new C1("m1v1", true, 1, { })); // infer mixin1 and Base parameters: [string, boolean, number, object]
console.log(new C2(false, 2, 1, { })); // infer mixin2 and Base parameters: [boolean, number, number, object]
console.log(new C3(false, 2, "m1v1", true, 1, { })); // infer mixin2, mixin1 and Base parameters: [boolean, number, string, boolean, number, object]
```
## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).