KT-6201 KT-6203 KT-6326 KT-6777 Add test cases to prove that issues are no longer reproducible

This commit is contained in:
Alexey Andreev
2016-04-05 15:35:39 +03:00
parent 33f9a0c798
commit 0869eb7ef3
5 changed files with 82 additions and 0 deletions
@@ -0,0 +1,15 @@
// See KT-6326, KT-6777
package foo
enum class Foo {
A;
companion object {
val a = A
}
}
fun box(): String {
assertEquals("A", Foo.a.name)
return "OK"
}
@@ -0,0 +1,25 @@
// See KT-6203
package foo
class TestClass {
object a {
override fun toString() = "a"
}
companion object {
object b {
override fun toString() = "b"
}
}
fun test() = convert(a) + convert(b)
}
fun convert(o: Any) = o.toString()
fun box(): String {
assertEquals("ab", TestClass().test())
assertEquals("ab2", convert(TestClass.a) + convert(TestClass.Companion.b) + "2")
return "OK"
}