TS: Parser error with assertion signatures #41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Returns types for assertion functions lead to parse errors:
https://www.typescriptlang.org/play/?#code/GYVwdgxgLglg9mABAQwM6oKYCcoAoIIAmMsCAXCmAJ4CUFamOqiBYxpSA3gFCKIzBEuAISt28MDUQ8+fKAAsscAO6IwGVQFEsSrLhoBuXogC+3M91CQOKdNigBJVAGUoWGGADmuAG7IANvTUdLaMUMx+-vzMqG4entLGAkJQVAAOGHCCkYjCALx5iABEse5eRVIysgpKqupaOnB6RQBycFAoiKXxwhVGfGYWhBgQ-shYGIj+GB3AcHBBVADaALqIAD5dcV4baiD+-kbcDPa4c3CG3JbzBogA9HdbZQmbyNSrVyc4Tq7PZ-OXa5wW4PJ7xIA
I wasn't even aware that syntax existed. Attached patch adds support.
asserts x is yworks now, but the following still gives me a parse error:All the examples of this I could find used
is. I cannot find the feature at all in the official docs. Do you have any resource that explains it properly?It's mentioned explicitly in the release notes for the relevant version: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions
I have never seen it mentioned anywhere else or used in any code, but I believe this is intended as an official feature.
Hrm, mentioning something in a release note and never documenting it is hardly a way to run a software project, if you ask me. But attached patch adds this form.