Fix CANNOT_CHECK_FOR_ERASED for when()

This commit is contained in:
Andrey Breslav
2012-08-31 14:23:02 +04:00
parent 002f34e6f5
commit 859dbc87d4
3 changed files with 22 additions and 9 deletions
@@ -0,0 +1,9 @@
enum class List<out T>(val size : Int) {
Nil : List<Nothing>(0)
}
fun List<String>.join() =
when (this) {
List.Nil -> "[]" // CANNOT_CHECK_FOR_ERASED was reported
else -> ""
}