diff --git a/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 569b2e9a2c8..c0dd2dc1958 100644 --- a/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -265,6 +265,7 @@ class RunExternalTestGroup extends JavaExec { def packages = new LinkedHashSet() def imports = [] def classes = [] + def vars = new HashSet() // variables that has the same name as a package TestModule mainModule = null def testFiles = TestDirectivesKt.buildCompileList(project.file("build/$src").toPath(), "$outputDirectory/$src") @@ -335,11 +336,10 @@ class RunExternalTestGroup extends JavaExec { } // now replace all package usages in full qualified names def res = "" // filesToCompile - def vars = new HashSet() // variables that has the same name as a package text.eachLine { line -> packages.each { pkg -> // line contains val or var declaration or function parameter declaration - if ((line =~ ~/va(l|r) *$pkg *\=/) || (line =~ ~/fun .*\(\n?\s*$pkg:.*/)) { + if ((line =~ ~/va(l|r) *$pkg *(get\(\))? *\=/) || (line =~ ~/fun .*\(\n?\s*$pkg:.*/)) { vars.add(pkg) } if (line.contains("$pkg.") && !(line =~ packagePattern || line =~ importRegex)