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

Add a warning on array children with inconsistent type #7376

Merged
merged 3 commits into from
Feb 6, 2025
Merged

Conversation

D8H
Copy link
Collaborator

@D8H D8H commented Feb 6, 2025

@D8H D8H requested a review from 4ian as a code owner February 6, 2025 14:45
parentVariable &&
parentVariable.getChildrenCount() > 1 &&
parentVariable.getAtIndex(0).getType() !== type
? i18n._(t`Array children must all be of the same type.`)
Copy link
Owner

Choose a reason for hiding this comment

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

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • "children" is better than "elements" in our case as it's how we call them.
  • "must" is already stronger than "should" so I see no reason to change it.
  • "for consistency" is just wrong, it's not about making it easier to understand, it's about making it work.

I think it's a good case of bad usage of AI. If you ask it to paraphrase it will, not always for the best.

Copy link
Owner

Choose a reason for hiding this comment

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

"All array children must be the same type".

then. My point was English phrasing ("XXX must all be of the same" ==> "All XXX must be the same type").

@D8H D8H merged commit 7c49346 into master Feb 6, 2025
5 of 6 checks passed
@D8H D8H deleted the array-warn branch February 6, 2025 17:29
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