We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TypeScript Version: 2.1.4-insiders.20161201
https://www.typescriptlang.org/play/index.html#src=type%20SelfRefObj%20%3D%20%22A%22%20%7C%20%7B%20%5Bkey%3A%20string%5D%3A%20SelfRefObj%20%7D%0D%0Atype%20SelfRefArr%20%3D%20%22A%22%20%7C%20%5BSelfRefArr%5D
Expected behavior:
Either both objects and arrays in type declarations can reference the type being declared, or neither.
Actual behavior:
Objects may reference the type being declared, but arrays throw an error
Use case:
Defining valid JSON as a type: type Json = boolean | number | string | null | { [key: string]: Json } | [Json]
The text was updated successfully, but these errors were encountered:
This is a known design limitation. However, you can use an intermediate interface type as described here.
Sorry, something went wrong.
No branches or pull requests
TypeScript Version: 2.1.4-insiders.20161201
https://www.typescriptlang.org/play/index.html#src=type%20SelfRefObj%20%3D%20%22A%22%20%7C%20%7B%20%5Bkey%3A%20string%5D%3A%20SelfRefObj%20%7D%0D%0Atype%20SelfRefArr%20%3D%20%22A%22%20%7C%20%5BSelfRefArr%5D
Expected behavior:
Either both objects and arrays in type declarations can reference the type being declared, or neither.
Actual behavior:
Objects may reference the type being declared, but arrays throw an error
Use case:
Defining valid JSON as a type:
type Json = boolean | number | string | null | { [key: string]: Json } | [Json]
The text was updated successfully, but these errors were encountered: