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

Fixed bug related to assigning to declared vals inside null-check branches #1851

Merged
merged 5 commits into from
Dec 11, 2023

Conversation

DrAlexD
Copy link
Member

@DrAlexD DrAlexD commented Dec 8, 2023

What's done:

  • Fixed bug related to case when if-else block inside init or run, with, apply blocks and there is more than one statement inside else block. This case leads to kotlin compilation error after adding run block instead of else block. Read https://youtrack.jetbrains.com/issue/KT-64174 for more information.
  • Added new warning tests.

Closes #1844

…nches

### What's done:
- Fixed bug related to case when `if-else` block inside `init` or 'run', 'with', 'apply' blocks and there is more than one statement inside 'else' block. This case leads to kotlin compilation error after adding 'run' block instead of 'else' block. Read https://youtrack.jetbrains.com/issue/KT-64174 for more information.
- Added new warning tests.

Closes #1844
@DrAlexD DrAlexD self-assigned this Dec 8, 2023
@DrAlexD DrAlexD added the bug Something isn't working label Dec 8, 2023
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (3059a40) 78.42% compared to head (b9f2e99) 78.44%.

Files Patch % Lines
...ol/diktat/ruleset/rules/chapter4/NullChecksRule.kt 92.30% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1851      +/-   ##
============================================
+ Coverage     78.42%   78.44%   +0.01%     
- Complexity     2442     2455      +13     
============================================
  Files           133      133              
  Lines          8632     8644      +12     
  Branches       2179     2184       +5     
============================================
+ Hits           6770     6781      +11     
  Misses          896      896              
- Partials        966      967       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Dec 8, 2023

JUnit Tests (macOS, EnricoMi/publish-unit-test-result-action@v2)

   164 files  ±0     164 suites  ±0   8m 11s ⏱️ + 2m 57s
1 412 tests +4  1 376 ✔️ +4  36 💤 ±0  0 ±0 
2 791 runs  +4  2 755 ✔️ +4  36 💤 ±0  0 ±0 

Results for commit d9d97c9. ± Comparison against base commit 0390093.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Dec 8, 2023

JUnit Tests (Windows, EnricoMi/publish-unit-test-result-action@v2)

   164 files  ±0     164 suites  ±0   7m 14s ⏱️ +23s
1 412 tests +4  1 395 ✔️ +4  17 💤 ±0  0 ±0 
2 791 runs  +4  2 774 ✔️ +4  17 💤 ±0  0 ±0 

Results for commit d9d97c9. ± Comparison against base commit 0390093.

♻️ This comment has been updated with latest results.

@DrAlexD DrAlexD enabled auto-merge (squash) December 11, 2023 09:34
@DrAlexD DrAlexD merged commit c7cad50 into master Dec 11, 2023
19 checks passed
@DrAlexD DrAlexD deleted the bugfix/assign-val branch December 11, 2023 09:38
@DrAlexD DrAlexD added this to the 2.0.0 milestone Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

false positive when assigning to a declared val with a branch null check
3 participants