Skip to content

Relax visbility rules for declaration emit #23127

Closed
@mhegazy

Description

@mhegazy

Visibility rules should be relaxed to only assert that a non-exported declaration is never exported.

class TreeNode {}
class Tree {
        // error TS4031: Public property 'Node' of exported class has or is using private name 'TreeNode'.
	Node: typeof TreeNode;
}
namespace Tree {
}
export = Tree;

another example:

interface I {
    a: number;
}

class C {
    // error TS4063: Parameter 'a' of constructor from exported class has or is using private name 'I'.
    constructor (a: I) { }
}

export default C;

Metadata

Metadata

Assignees

Labels

Domain: Declaration EmitThe issue relates to the emission of d.ts filesFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions