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.5.2
Code
type TypeDescription<T> = {[prop in keyof T]: undefined }; function getAllProperties<T>(typeDesc: (T|TypeDescription<T>)): ReadonlyArray<keyof T> { const props: Array<keyof T> = []; for (var iPropName in typeDesc) { props.push(iPropName); } return props; }
Expected behavior: Should compile file (used to be in Ts-2.3)
Actual behavior: Compile errors with "The right-hand side of 'for ... in' ...".
The text was updated successfully, but these errors were encountered:
T extends object or T extends {} should avoid the error for now.
T extends object
T extends {}
Sorry, something went wrong.
Please, don't fix the new correct behaviour. It's been a bug in the compiler that has allowed this unsafe iteration.
Agreed, this doesn't seem like a bug.
No branches or pull requests
TypeScript Version: 2.5.2
Code
Expected behavior:
Should compile file (used to be in Ts-2.3)
Actual behavior:
Compile errors with "The right-hand side of 'for ... in' ...".
The text was updated successfully, but these errors were encountered: