[FIR] Add diagnostic collection to KotlinToJVMBytecodeCompiler

This commit is contained in:
Mikhail Glukhikh
2020-08-04 09:55:14 +03:00
parent 9c3b8484b9
commit e841b3a77b
5 changed files with 89 additions and 9 deletions
+6
View File
@@ -3,4 +3,10 @@ fun println(val x: Int) {}
fun main() {
val x: Int
println(x)
}
private class Private
class Public : Private() {
val x: Private
}
+10 -1
View File
@@ -1 +1,10 @@
OK
compiler/testData/cli/jvm/firError.kt:5:13: error: x must be initialized before access
println(x)
^
compiler/testData/cli/jvm/firError.kt:10:16: error: public subclass exposes its private supertype Private
class Public : Private() {
^
compiler/testData/cli/jvm/firError.kt:11:9: error: public property exposes its private type Private
val x: Private
^
COMPILATION_ERROR