Files
kotlin-fork/j2k/testData/fileOrElement/issues/kt-807.kt
T
Alexander Udalov e915e1548c Fix multiple 'unresolved java classifier' errors
Use the same component (NotFoundClasses) as in loading of compiled Kotlin
symbols.

Some tests were changed to avoid a diagnostic that is now reported when a
non-found class is encountered in a signature (e.g. staticMethod.1.java where
JDK seems to be not configured)

 #KT-10493 Fixed
 #KT-10820 Fixed
 #KT-11368 Fixed
2016-03-28 14:13:59 +03:00

23 lines
1.1 KiB
Kotlin
Vendored

// ERROR: None of the following functions can be called with the arguments supplied: public constructor FileInputStream(p0: File!) defined in java.io.FileInputStream public constructor FileInputStream(p0: FileDescriptor!) defined in java.io.FileInputStream public constructor FileInputStream(p0: String!) defined in java.io.FileInputStream
// ERROR: Type mismatch: inferred type is DataInputStream but InputStream! was expected
// ERROR: Assignments are not expressions, and only expressions are allowed in this context
// ERROR: Unresolved reference: close
import java.io.*
internal object FileRead {
@JvmStatic fun main(args: Array<String>) {
try {
val fstream = FileInputStream()
val `in` = DataInputStream(fstream)
val br = BufferedReader(InputStreamReader(`in`))
var strLine: String
while ((strLine = br.readLine()) != null) {
println(strLine)
}
`in`.close()
} catch (e: Exception) {
System.err.println("Error: " + e.message)
}
}
}