Skip to content
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

Private name errors #2

Closed

Conversation

jbhoosreddy
Copy link
Member

@jbhoosreddy jbhoosreddy commented Jul 2, 2018

This PR is an effort to identify all the possible errors that might happen when using private fields in Typescript. As @mheiber said, this is a good opportunity to give developers good and meaningful errors when they run into these situations.

Co-authored by: @mheiber, @joeywatts

Maxwell Heiber and others added 15 commits July 2, 2018 15:41
start the work for basic errors.

Plan for developing error spec: PR into the private-name-errors branch with example files in tests/cases/classes/privateNames.

In those files, have sample code.
If a line is interesting and does not error, end it with // OK
If a line is interesting and does error, end it with // Error:
* errrors for mixing modifiers and private names

The plan was to allow these to be mixed, but I think
it's better to not allow any modifiers with private names
because afaik there is no use case for:

private #foo

It has the disadvantage of being more restrictive than
`#foo` (no structural typing for classes with `private`)
but does not have any of the advantages of `private`

* tests case for #constructor reserved

* Update privateNameContructorReserved.ts
mheiber pushed a commit that referenced this pull request Jul 2, 2018
* jenkinsfile

* add npm run build step

* lint

* baseline change

* accept more baselines

* accept baselines

* fix-scanner

* baselines again
joeywatts referenced this pull request in joeywatts/TypeScript Jul 3, 2018
* jenkinsfile

* add npm run build step

* lint

* baseline change

* accept more baselines

* accept baselines

* fix-scanner

* baselines again
joeywatts referenced this pull request in joeywatts/TypeScript Aug 21, 2018
* jenkinsfile

* add npm run build step

* lint

* baseline change

* accept more baselines

* accept baselines

* fix-scanner

* baselines again
@Neuroboy23
Copy link

@jbhoosreddy @mheiber @joeywatts What's the status of this PR? It's been hanging around while.

@mheiber
Copy link

mheiber commented Dec 3, 2018

superceded by other PRs, esp. the checker PR.
I moved over some of the same commits, so attribution isn't lost

@mheiber mheiber closed this Dec 3, 2018
dragomirtitian pushed a commit that referenced this pull request Aug 22, 2023
1. Reformat union types
2. Do not add type annotation when not needed
3. Fix tests for #2 changes.

Signed-off-by: Hana Joo <hanajoo@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants