Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle not-nullable parameters in Kotlin constructors correctly #1336#1352

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@volivan239
Copy link
Collaborator

Description

If constructor in Kotlin code has not-nullable reference parameter, compiler adds instructions callingkotlin/jvm/internal/Intrinsics.checkNotNullParameter. But in constructor analyzer we accept constructors iff they "contain only statements matching patternthis.a = something wherea is an argument of the constructor". Therefore, we need to add exception for calls to the function above. Also, these calls may reorder local variables, so minor changes inindexToField were needed

Fixes#1336

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual Scenario

Checked on example from#1336 -- works as expected (but only when settings are Fuzzer 100%, engine creates only tests where parameter is null, which do not pass concrete executor -- see#1257)

Checklist (remove irrelevant options):

This is the author self-check list

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

@volivan239volivan239 changed the titleHandle not-nullable parameters in Kotlin constructors correctlyHandle not-nullable parameters in Kotlin constructors correctly #1336Nov 11, 2022
@volivan239volivan239 marked this pull request as ready for reviewNovember 11, 2022 09:02
@volivan239volivan239 merged commit30499ad intomainNov 15, 2022
@volivan239volivan239 deleted the volivan239/fix_not_nullable_parameters_in_constructors branchNovember 15, 2022 12:09
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@EgorkaKulikovEgorkaKulikovEgorkaKulikov approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AssembleModel unable to analyze Kotlin constructors with not nullable reference parameters

3 participants

@volivan239@EgorkaKulikov

[8]ページ先頭

©2009-2025 Movatter.jp