Files
kotlin-fork/compiler/testData/codegen/box/classes/kt2390.kt
T
Juan Chen 4c04ad2371 FIR: Add bindings for dispatch receiver parameters
Before this commit, such descriptors have null owners, which causes problems when the getter of the owner property is called.
2019-12-27 10:13:44 +03:00

36 lines
789 B
Kotlin
Vendored

class JsonObject() {
}
class JsonArray() {
}
public interface Formatter<in IN: Any, out OUT: Any> {
public fun format(source: IN?): OUT
}
public interface MultiFormatter <in IN: Any, out OUT: Any> {
public fun format(source: Collection<IN>): OUT
}
public class Project() {
}
public interface JsonFormatter<in IN: Any>: Formatter<IN, JsonObject>, MultiFormatter<IN, JsonArray> {
public override fun format(source: Collection<IN>): JsonArray {
return JsonArray();
}
}
public class ProjectJsonFormatter(): JsonFormatter<Project> {
public override fun format(source: Project?): JsonObject {
return JsonObject()
}
}
fun box(): String {
val formatter = ProjectJsonFormatter()
return if (formatter.format(Project()) != null) "OK" else "fail"
}