https://kotlinlang.org logo
#compiler
Title
# compiler
a

ansman

03/14/2024, 8:06 PM
Not sure if this is a good place for this question but I'm looking for confirmation this is a compiler bug so I can file an issue. I'm unable to access properties on an object when I switch to using a wildcard, here's a repro:
Copy code
class Super<T1, T2>
data class Child<T : Super<String, Child<T>>>(val foo: String)

fun foo(child: Child<*>) {
    child.foo
}
This fails to compile with an error on
child.foo
saying:
Copy code
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public final val foo: String defined in com.example
d

dmitriy.novozhilov

03/15/2024, 6:20 AM
Yeah, it seems like a bug I checked K2 compiler, it compiles this code fine