File tree Expand file tree Collapse file tree
src/test/kotlin/nullability/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 */
1616package nullability.test
1717
18+ import java.nio.file.Files
1819import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
1920import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
2021import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSourceLocation
2122import org.jetbrains.kotlin.cli.common.messages.MessageCollector
2223import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
2324import org.jetbrains.kotlin.config.Services
24- import java.io.File
2525
2626/* *
2727 * Compiles the source lines and returns any error reports generated by the compiler.
2828 */
2929fun compile (source : String ): CompilerErrorMessageCollector {
30- val file: File = File .createTempFile(" KotlinTest" , " .kt" )
30+ val file = Files .createTempFile(" KotlinTest" , " .kt" ).toFile( )
3131 file.deleteOnExit()
3232 // normalize line endings and write to temp file
3333 file.writeText(source.trimIndent().lines().joinToString(separator = System .lineSeparator()))
You can’t perform that action at this time.
0 commit comments