Resolution: extract projections from captured flexible type properly
#KT-54100 Fixed Related to KT-54196, KT-54198
This commit is contained in:
committed by
teamcity
parent
8517249776
commit
e9bb0f4fda
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// FILE: spr/Expr.java
|
||||
package spr;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface Exec<E> {
|
||||
boolean run(@NotNull Model model, @NotNull Processor<? super E> params);
|
||||
}
|
||||
|
||||
// FILE: spr/foo.kt
|
||||
package spr
|
||||
|
||||
open class Processor<P> {
|
||||
fun process(t: P): Boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
class Model
|
||||
|
||||
fun <C> context(p: Processor<in C>, exec: Exec<C>) {}
|
||||
|
||||
fun <M> materialize(): Processor<M> = TODO()
|
||||
|
||||
private fun foo(model: Model) {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER("M")!>materialize<!>().<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER("T")!>apply<!> {
|
||||
context(
|
||||
this,
|
||||
Exec { m, p -> p.process(m) } // Note: Builder inference
|
||||
)
|
||||
}
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// FILE: spr/Expr.java
|
||||
package spr;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface Exec<E> {
|
||||
boolean run(@NotNull Model model, @NotNull Processor<? super E> params);
|
||||
}
|
||||
|
||||
// FILE: spr/foo.kt
|
||||
package spr
|
||||
|
||||
open class Processor<P> {
|
||||
fun process(t: P): Boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
class Model
|
||||
|
||||
fun <C> context(p: Processor<in C>, exec: Exec<C>) {}
|
||||
|
||||
fun <M> materialize(): Processor<M> = TODO()
|
||||
|
||||
private fun foo(model: Model) {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materialize<!>().<!DEBUG_INFO_MISSING_UNRESOLVED!>apply<!> {
|
||||
context(
|
||||
<!NO_THIS!>this<!>,
|
||||
Exec { m, p -> p.process(m) } // Note: Builder inference
|
||||
)
|
||||
}
|
||||
}
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
package
|
||||
|
||||
package spr {
|
||||
public fun </*0*/ C> context(/*0*/ p: spr.Processor<in C>, /*1*/ exec: spr.Exec<C>): kotlin.Unit
|
||||
private fun foo(/*0*/ model: spr.Model): kotlin.Unit
|
||||
public fun </*0*/ M> materialize(): spr.Processor<M>
|
||||
|
||||
public interface Exec</*0*/ E : kotlin.Any!> {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public abstract fun run(/*0*/ @org.jetbrains.annotations.NotNull model: spr.Model, /*1*/ @org.jetbrains.annotations.NotNull params: spr.Processor<in E!>): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Model {
|
||||
public constructor Model()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class Processor</*0*/ P> {
|
||||
public constructor Processor</*0*/ P>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun process(/*0*/ t: P): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user