test that fails
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
abstract open class Default {
|
||||||
|
fun defaultValue(): Int
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyInt() {
|
||||||
|
class object : Default {
|
||||||
|
override fun defaultValue(): Int = 610
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun toDefault<T: Any> where class object T: Default(t: T) = T.defaultValue()
|
||||||
|
|
||||||
|
fun box(): String = if (toDefault<MyInt>(MyInt()) == 610) "OK" else "fail"
|
||||||
@@ -119,4 +119,8 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
public void testClassObject() throws Exception {
|
public void testClassObject() throws Exception {
|
||||||
blackBoxFile("classes/classObject.jet");
|
blackBoxFile("classes/classObject.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testClassObjectMethod() throws Exception {
|
||||||
|
blackBoxFile("classes/classObjectMethod.jet");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user