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

Remove redundant non-null assertion operators. #198

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

12wrigja
Copy link
Contributor

@12wrigja 12wrigja commented Dec 6, 2022

No description provided.

Copy link
Contributor

@justingrant justingrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the assertions aren't needed anymore, OK to remove them... but should validate that they don't break the original reason why we put them there. See comment.

@@ -334,7 +334,7 @@ export class Calendar implements Temporal.Calendar {
static from(item: Params['from'][0]): Return['from'] {
return ES.ToTemporalCalendar(item);
}
[Symbol.toStringTag]!: 'Temporal.Calendar';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the reason we originally added this assertion (see #53 (comment)) not apply anymore? Does TS now emit [Symbol.toStringTag] even without the ! assertion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is not actually a non-null assertion, it's a "definite assignment assertion" that means that this field will be initialized by non-constructor code.

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

Successfully merging this pull request may close these issues.

2 participants