Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixin function failed to compile when exported with --declaration #14317

Closed
vietthang opened this issue Feb 26, 2017 · 1 comment
Closed

Mixin function failed to compile when exported with --declaration #14317

vietthang opened this issue Feb 26, 2017 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@vietthang
Copy link

TypeScript Version: 2.2.1

Code
Extract from official example:

// A *self-contained* demonstration of the problem follows...
export type Constructor<T> = new(...args: any[]) => T;

export function Tagged<T extends Constructor<{}>>(Base: T) {
  return class extends Base {
    _tag: string;
    constructor(...args: any[]) {
        super(...args);
        this._tag = "";
    }
  };
}

Expected behavior:
Code compiled fine.

Actual behavior:
This code fail to compile with --declaration options. The error is:

Return type of exported function has or is using private name '(Anonymous class)'.

It compiled fine without --declaration. Did I miss something?

@DanielRosenwasser
Copy link
Member

Duplicate of #14209 and therefore #14075.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Feb 26, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants