Introduce warnings reporting by missed constraints because of incorrect optimization in the constraints processor

This commit is contained in:
Victor Petukhov
2021-04-26 20:14:21 +03:00
parent e110b49cab
commit 7c62e9aecd
41 changed files with 535 additions and 46 deletions
+15
View File
@@ -0,0 +1,15 @@
// IGNORE_BACKEND_FIR: JVM_IR
sealed class Subtype<A1, B1> {
abstract fun cast(value: A1): B1
class Trivial<A2 : B2, B2> : Subtype<A2, B2>() {
override fun cast(value: A2): B2 = value
}
}
fun <A, B> unsafeCast(value: A): B {
val proof: Subtype<A, B> = Subtype.Trivial()
return proof.cast(value)
}
fun box() = "OK"