Skip to content

Why do we have to copy the members of interface to class definitions? #42

@e-cloud

Description

@e-cloud

see

private _resolveInterfaceMembers(docs: TDoclet[]) {

a reasonable version

// jsdoc marked as mixin
interface A {
	a(): void;
}

// jsdoc marked as interface
interface B {
	b(): void;
}

class C implements A, B {
}

current output

// jsdoc marked as mixin
interface A {
	a(): void;
}

// jsdoc marked as interface
interface B {
	b(): void;
}

class C implements A, B {
	static a(): void;
	b(): void;
}

The reason of static occurrence is because in jsdoc mixins do not apply scope: instance.

I can not figure out why should we copy those members to class. IMO, it's unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions