Skip to content

Conversation

@SuperUserDone
Copy link
Contributor

No description provided.

@SuperUserDone SuperUserDone requested a review from ml86 January 22, 2026 11:12
val typeFullName = registerType(exprTypeFullName(expression).getOrElse(TypeConstants.Any))
val identifier = identifierNode(arrayExpr, arrayExpr.getText, arrayExpr.getText, typeFullName)
val identifierAst = astWithRefEdgeMaybe(arrayExpr.getText, identifier)
val identifierAst = astsForExpression(arrayExpr, None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Variable name should also be updated. Something like baseExpression seems appropriate.

Comment on lines 84 to 90
"should contain a listOf Call with the correct arguments" in {
cpg.call.name("listOf").length shouldBe 1
val List(call) = cpg.call.name("listOf").l
call.argument.length shouldBe 3
call.argument(1).code shouldBe "1"
call.argument(2).code shouldBe "2"
call.argument(3).code shouldBe "3"
Copy link
Contributor

Choose a reason for hiding this comment

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

This call to listOf could be anywhere in the CPG.
The test would have much better form if you start by selecting the array access call, expand to argument 0 and check if that is a call to listOf. From there you can then check its arguments like you already do.

@SuperUserDone SuperUserDone requested a review from ml86 January 22, 2026 13:45
@ml86 ml86 merged commit f59e8cf into master Jan 22, 2026
8 checks passed
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.

3 participants