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

AssembleModel unable to analyze Kotlin constructors with not nullable reference parameters #1336

Closed
Assignees
volivan239
Labels
comp-codegenIssue is related to code generatorctg-bugIssue is a buglang-kotlinIssue is related to Kotlin language support
@volivan239

Description

@volivan239

Description

Right now we are unable to properly assemble models if there are not nullable reference parameters in constructor -- such models are instantiated through reflection right now.

To Reproduce

Launch action on classSample from below:

data classPoint(varx:Int,vary:Int)classSample(valy:Point) {funtest():Int {if (y.x==2)return-1return0    }}

Expected behavior

Tests with assembled models are generated.

Actual behavior

Classes are instantiated through reflection

Visual proofs (screenshots, logs, images)

@TestfuntestKek1() {val s= (createInstance("nullability.Sample")asSample)val point= (createInstance("nullability.Point")asPoint)    point.x=2    setField(s,"nullability.Sample","y", point)val actual= kek(s)        assertEquals(-1, actual)}

Environment

Symbolic execution 100%.

Additional context

Seems like the problem is that Kotlin compiler adds to constructor ofSample instructions likeINVOKESTATIC kotlin/jvm/internal/Intrinsics.checkNotNullParameter (Ljava/lang/Object;Ljava/lang/String;)V

This leads to incorrect behavior ofisAppropriate and other methods inConstructorAnalyzer

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorctg-bugIssue is a buglang-kotlinIssue is related to Kotlin language support

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp