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

Implement move_color_to_decoration #3064

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

Conversation

minhqdao
Copy link
Contributor

Description

When a Container is provided with both color and decoration (both non-null), an error is thrown at runtime, and there is currently nothing that warns you about that beforehand. This rule prevents you from running into the error by prompting to move color into decoration.

Fixes #3063

@google-cla google-cla bot added the cla: yes label Nov 16, 2021
Copy link
Member

@bwilkerson bwilkerson left a comment

Choose a reason for hiding this comment

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

Ignoring the question of whether we should have a more general solution for flagging such situations, this PR lgtm.

@srawlins
Copy link
Member

CC @goderbauer what do you think?

@srawlins
Copy link
Member

An alternative implementation we might want is an annotation like OnlyOneOf. dart-lang/sdk#47712

@goderbauer
Copy link
Contributor

Having a lint on this would be nice.

@srawlins
Copy link
Member

Sorry for the delay in review. I still think dart-lang/sdk#47712 is a great alternative, but we haven't prioritized designing that annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

proposal: move_color_to_decoration
4 participants