Skip to content

Commit

Permalink
Fix some FIR warnings (#2319)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton authored Sep 24, 2024
1 parent cfe56e7 commit 362dafa
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import java.net.URLClassLoader
import org.jetbrains.kotlin.KtSourceElement
import org.jetbrains.kotlin.KtVirtualFileSourceFile
import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY
import org.jetbrains.kotlin.cli.common.GroupedKtSources
import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoots
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
Expand All @@ -46,6 +45,7 @@ import org.jetbrains.kotlin.com.intellij.openapi.util.Disposer
import org.jetbrains.kotlin.com.intellij.openapi.vfs.StandardFileSystems
import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileManager
import org.jetbrains.kotlin.com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.kotlin.config.CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY
import org.jetbrains.kotlin.config.CommonConfigurationKeys.MODULE_NAME
import org.jetbrains.kotlin.config.CommonConfigurationKeys.USE_FIR
import org.jetbrains.kotlin.config.CompilerConfiguration
Expand Down Expand Up @@ -151,13 +151,9 @@ public fun parseProtocolSchema(
val localFileSystem = VirtualFileManager.getInstance().getFileSystem(
StandardFileSystems.FILE_PROTOCOL,
)
val files = buildList {
for (source in sources) {
source.walkTopDown().filter { it.isFile }.forEach {
this += localFileSystem.findFileByPath(it.absolutePath)!!
}
}
}
val files = sources
.flatMap { it.walkTopDown().filter(File::isFile) }
.map { localFileSystem.findFileByPath(it.absolutePath)!! }

val sourceFiles = files.map(::KtVirtualFileSourceFile).toSet()
val input = ModuleCompilerInput(
Expand Down

0 comments on commit 362dafa

Please sign in to comment.