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

kotlin2cpg: call primary ctor in secondary ctors #1931

Merged
merged 3 commits into from
Nov 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use defined constant
  • Loading branch information
ursachec committed Nov 2, 2022
commit 620556a14901c73063e50de40e0eef5c677d1442
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.joern.kotlin2cpg.querying

import io.joern.kotlin2cpg.Constants
import io.joern.kotlin2cpg.testfixtures.KotlinCode2CpgFixture
import io.shiftleft.codepropertygraph.generated.{DispatchTypes, Operators}
import io.shiftleft.codepropertygraph.generated.nodes.{Call, FieldIdentifier, Identifier, MethodParameterIn}
Expand Down Expand Up @@ -190,7 +191,7 @@ class ConstructorTests extends KotlinCode2CpgFixture(withOssDataflow = false) {
m.methodReturn.lineNumber shouldBe Some(6)
m.methodReturn.columnNumber shouldBe Some(4)

m.block.astChildren.map(_.code).l shouldBe List("<init>", "this.bar = bar")
m.block.astChildren.map(_.code).l shouldBe List(Constants.init, "this.bar = bar")

val List(mThisParam: MethodParameterIn, firstParam: MethodParameterIn, secondParam: MethodParameterIn) =
m.parameter.l
Expand Down