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

UnnecessaryInnerClass: add test for safe qualified expressions #4864

Merged
merged 1 commit into from May 27, 2022
Merged

UnnecessaryInnerClass: add test for safe qualified expressions #4864

merged 1 commit into from May 27, 2022

Conversation

dzirbel
Copy link
Contributor

@dzirbel dzirbel commented May 26, 2022

Add a unit test for a bug in which safe qualified references to a nullable field
in the parent class (i.e. as ?.) would not be marked as warnings in release
1.20.0. This issue has been inadvertently fixed by
#4738, but adding a unit test will guard
against future regressions.

I was able to confirm this test fails by checking out the 1.20.0 tag and running
the unit test; against that tag the fix was to override the
visitSafeQualifiedExpression() function with the same logic as
visitCallExpression().

Add a unit test for a bug in which safe qualified references to a nullable field
in the parent class (i.e. as `?.`) would not be marked as warnings in release
1.20.0. This issue has been inadvertently fixed by
#4738, but adding a unit test will guard
against future regressions.

I was able to confirm this test fails by checking out the 1.20.0 tag and running
the unit test; against that tag the fix was to override the
visitSafeQualifiedExpression() function with the same logic as
visitCallExpression().
@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #4864 (a43bc03) into main (fcd9c48) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #4864   +/-   ##
=========================================
  Coverage     84.79%   84.79%           
  Complexity     3447     3447           
=========================================
  Files           492      492           
  Lines         11315    11315           
  Branches       2083     2083           
=========================================
  Hits           9595     9595           
  Misses          673      673           
  Partials       1047     1047           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcd9c48...a43bc03. Read the comment docs.

@dzirbel
Copy link
Contributor Author

dzirbel commented May 26, 2022

Hm, looks like some a checks on windows failed due to gradle running out of memory; is there any easy way to re-run the check?

@schalkms schalkms added this to the 1.21.0 milestone May 27, 2022
@schalkms schalkms merged commit 2e2d471 into detekt:main May 27, 2022
@dzirbel dzirbel deleted the unnecessaryInnerClassSafeQualified branch May 27, 2022 07:21
@schalkms
Copy link
Member

CI on Windows is sometimes flaky in this repo. Therefore, I triggered a rerun.
Thanks for the PR btw!

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.

None yet

2 participants