class Controller { fun yield(t: T): Boolean = true } fun generate(g: suspend Controller.() -> Unit): S = TODO() fun select(x: E4, y: E4) {} fun selectL(x: E5, y: E5, l: (E5) -> Unit) {} fun main(x: Controller) { generate { // Just adding the constraints // Controller <: E4 // Controller <: E4 // No fixation is required select(x, this) }.length generate { // Adding the constraints // Controller <: E5 // Controller <: E5 // But to analyze lambda we fix E5 to CST(Controller, Controller) = Controller // The question is what is CST(String, S) // And current answer in K2 is that it's String just the same way as when while fixating some TV, it has improper lower constraits // See org.jetbrains.kotlin.resolve.calls.inference.components.ResultTypeResolver.prepareLowerConstraints selectL(x, this) { x -> x.yield(1) x.yield("") } }.length }