From e8a2c58759840fce16e3345f4ff59a3b620b0b0c Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Wed, 19 Sep 2018 17:23:05 +0300 Subject: [PATCH] Fix KonanTest to correctly replace packages when test contains function parameters with the same name as package --- .../src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 74fd068b8f1..cc3c7390333 100644 --- a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -791,7 +791,8 @@ class RunExternalTestGroup extends RunStandaloneKonanTest { def vars = new HashSet() // variables that has the same name as a package text.eachLine { line -> packages.each { pkg -> - if (line =~ ~/va(l|r) *$pkg *\=/) { + // line contains val or var declaration or function parameter declaration + if ((line =~ ~/va(l|r) *$pkg *\=/) || (line =~ ~/fun .*\(\n?\s*$pkg:.*/)) { vars.add(pkg) } if (line.contains("$pkg.") && ! (line =~ packagePattern || line =~ importRegex)