mirror of
https://github.com/safishamsi/graphify.git
synced 2026-07-17 12:57:18 +00:00
9b040224e1
class Foo : Bar by baz produced no edge because the delegation_specifier loop only handled constructor_invocation and bare user_type children; the by form wraps user_type in an explicit_delegation node. Add that branch so the implements edge (and generic-arg recovery) fires.
44 lines
959 B
Kotlin
44 lines
959 B
Kotlin
import kotlinx.coroutines.delay
|
|
import kotlin.math.max
|
|
|
|
data class Config(val baseUrl: String, val timeout: Int)
|
|
|
|
class HttpClient(private val config: Config) {
|
|
fun get(path: String): String {
|
|
return buildRequest("GET", path)
|
|
}
|
|
|
|
fun post(path: String, body: String): String {
|
|
return buildRequest("POST", path)
|
|
}
|
|
|
|
private fun buildRequest(method: String, path: String): String {
|
|
return "$method ${config.baseUrl}$path"
|
|
}
|
|
}
|
|
|
|
interface Loggable {
|
|
fun log()
|
|
}
|
|
|
|
open class BaseProcessor
|
|
|
|
class Result<T>
|
|
|
|
class DataProcessor : BaseProcessor(), Loggable {
|
|
var current: Result<DataProcessor> = Result()
|
|
|
|
fun run(input: DataProcessor): Result<DataProcessor> {
|
|
return current
|
|
}
|
|
|
|
override fun log() {}
|
|
}
|
|
|
|
class LoggingList<T>(inner: MutableList<T>) : MutableList<T> by inner
|
|
|
|
fun createClient(baseUrl: String): HttpClient {
|
|
val config = Config(baseUrl, 30)
|
|
return HttpClient(config)
|
|
}
|