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

Issue 4195. Add type_literal_in_constant_pattern #4207

Merged

Conversation

scheglov
Copy link
Contributor

Obviously, cannot be landed with dependency overrides, will clean up after initial review.

Fixes #4195

@scheglov scheglov requested review from pq and bwilkerson March 23, 2023 18:29
Copy link
Member

@pq pq left a comment

Choose a reason for hiding this comment

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

Looks great! I'll defer to @eernstg in case he has any questions about semantics but this handles the cases I'm aware of (and most concerned about), so cool!

lib/src/rules/no_constant_pattern_type_literal.dart Outdated Show resolved Hide resolved
@scheglov scheglov force-pushed the prefer_pattern_type_literal_equality branch from b94a508 to 790ef6e Compare March 23, 2023 19:02
@scheglov scheglov changed the title Issue 4195. Add no_constant_pattern_type_literal Issue 4195. Add type_literal_in_constant_pattern Mar 23, 2023
@coveralls
Copy link

coveralls commented Mar 24, 2023

Coverage Status

Coverage: 96.336% (+0.007%) from 96.329% when pulling 5ee4906 on scheglov:prefer_pattern_type_literal_equality into 13a97ae on dart-lang:main.

@scheglov scheglov force-pushed the prefer_pattern_type_literal_equality branch from 2cc3f85 to 5ee4906 Compare March 24, 2023 15:54
@scheglov scheglov merged commit 50b4ef2 into dart-lang:main Mar 24, 2023
9 checks passed
@scheglov scheglov deleted the prefer_pattern_type_literal_equality branch March 24, 2023 16:55
mockturtl added a commit to mockturtl/tidy that referenced this pull request May 20, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Aug 23, 2023
* Fixes for review comments.

* Enable only for Type supertypes.

* tweak
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.

Lint for using a type literal in a switch case
4 participants