Skip to content

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

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

Closed
RyanCavanaugh opened this issue Jul 21, 2014 · 1 comment
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Spec Issues related to the TypeScript language specification

Comments

@RyanCavanaugh
Copy link
Member

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, ..."

@sophiajt
Copy link
Contributor

Moving to Anders to review and make the spec change.

@sophiajt sophiajt assigned ahejlsberg and unassigned sophiajt Aug 18, 2014
@RyanCavanaugh RyanCavanaugh added the Fixed A PR has been merged for this issue label Sep 11, 2014
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Spec Issues related to the TypeScript language specification
Projects
None yet
Development

No branches or pull requests

5 participants