Skip to content

Spec: Non-public class members should not contribute to the "depends on" closure of module visibility requirements #163

Closed
@RyanCavanaugh

Description

@RyanCavanaugh

Spec section 10.4 defines which internal module members need to be exported to prevent a visibility error:

• A class directly depends on each Type specified as a type parameter constraint, each TypeReference specified as a base class or implemented interface, and each Type specified in a constructor parameter type annotation, member variable type annotation, member function parameter or return type annotation, member accessor parameter or return type annotation, or index signature type annotation.

That implies this code should be invalid, but this used to be allowed and still should be:

module M {
    interface p { }
    export class C {
         private x(n: p) {}
    }
}

I think the quoted bullet above should say "each Type specified in a public constructor type annotation, ..."

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueSpecIssues related to the TypeScript language specification

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions