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

Nominal typing support like opaque type #28515

Closed
5 tasks done
xiaoxiangmoe opened this issue Nov 14, 2018 · 2 comments
Closed
5 tasks done

Nominal typing support like opaque type #28515

xiaoxiangmoe opened this issue Nov 14, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@xiaoxiangmoe
Copy link
Contributor

xiaoxiangmoe commented Nov 14, 2018

Search Terms

Nominal typing/ opaque type

Suggestion

support https://flow.org/en/docs/types/opaque-types/

Use Cases

Examples

// @flow
opaque type ID = string;

function identity(x: ID): ID {
  return x;
}
export type {ID};

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@jack-williams
Copy link
Collaborator

Duplicate of #202, related #4895.

@DanielRosenwasser DanielRosenwasser added the Duplicate An existing issue was already created label Nov 14, 2018
@typescript-bot
Copy link
Collaborator

This issue has been marked as a duplicate and has seen no activity in the last day. It has been closed for automatic house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants