Skip to content

Cannot extend from type which constructs intersection of type parameter with a default #16211

@DanielRosenwasser

Description

@DanielRosenwasser
interface VueCtor {
    new <D = object>(d: D): Vue & D;
}

interface Vue {
}

declare var Vue: VueCtor;


class A extends Vue {
    //          ~~~
    // Error: Base constructor return type 'Vue & D' is not a class or interface type.
}

I thought this might have to do with the constraint, but adding an explicit D extends object = object doesn't work either.

Is it possible that D isn't correctly getting instantiated with its default type argument when extending from Vue?

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions