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

Bound generic types don't warn until used #5409

Open
amsul opened this issue Nov 26, 2017 · 0 comments
Open

Bound generic types don't warn until used #5409

amsul opened this issue Nov 26, 2017 · 0 comments

Comments

@amsul
Copy link

amsul commented Nov 26, 2017

Hi there! Thanks for the awesome library.

I found a small inconvenience when using generic types. This snippet should warn, but doesn't:

type NameType = 'user'
type ObjectType<Name: NameType> = {
  name: Name,
}
type UserType = ObjectType<'lol'>

..until I try to use it:

const user: UserType = {
  name: 'user',
}

https://flow.org/try/#0C4TwDgpgBAcghgWwgFXNAvFA5AVwM4QBOWAUKJFAPIBGAVhAMbCqQA88SAXLIimgHxRMAbxJQoAO17cOEADQkAvmTRQAqgUIsMVOo2ZpWWADYB7Y1n4kSAegBUdqDZINTEvMCj4i3DUW1CUKLiUlzY3sQKyvZ2NkA

Not sure how to go about fixing it. But if there are any pointers, I would be glad to submit a PR 🙏

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

No branches or pull requests

1 participant