-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
The documentation of limited excess property checking introduced with ts 3.5 understates actual behavior #44871
Comments
The description in 3.5's release notes is intended, as far as I understand it. In general, however, the release notes give a friendly summary of the changes, and are not spec-quality. PRs usually give semantics β for complex features at least β but features are distributed across multiple PRs. Unfortunately, the priorities of the team and Typescript's open source nature combine to make it a spec-free language. That means semantics are argued per-feature rather than up-front when writing the spec. |
This comment has been minimized.
This comment has been minimized.
My last reply was too wordy. I hid it to reduce noise.
Yes and no.
(*) Nevertheless, it is preferable not to have documentation that is specific but inaccurate. "Excess property checking" is only a single feature, not a collection of features. The code will be all in one place. Checking regression in playground, it appears not to have changed since the 3.5 release. |
This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow. |
Bug Report
π Search Terms
Excess Property Checks
π Version & Regression Information
3.5
β― Playground Link
Playground link with relevant code
π» Code
π Actual documentation
π Expected documentation
The actual documentation does not match that observed in the code above. For example, that actual documentation would imply that an empty object could always be assigned to a union of object with required properties, and that is obviously false. So perhaps what the author meant would be given by this slight rewording of the actual documentation:
Equivalently -
This expected documentation
Request to confirm actual intended design behavior.
The above "expected documentation" assumes the intended behavior of the typescript design, based on some supporting evidence (the playground code). However, although that evidence proves that the actual (current) documentation does not match the actual current behavior, it does not prove that the "expected documentation" (above) accurately describes the intended design behavior.
If the intended design behavior does not match that described in "Expected Documentation" then please give an unambiguous description of the intended design behavior.
Downstream development using the typescript API may depend upon knowing what semantics result in a compiler error and what don't. Of course the specs can change (the typescript API documentation warns about that), but having "no hard spec for excess property checking" is different than having "hard excess property checking specs that may change in the future".
The text was updated successfully, but these errors were encountered: