This is purely an IDE bug. I am getting ```Functio...
# intellij
a
This is purely an IDE bug. I am getting
Copy code
Function1<? super T, ? extends R> is not a functional interface
when passing a lambda argument that is written in common main. Any one else getting this? What version of IDEA are you all using? More on thread
I have the following files
commonMain/Box.kt
Copy code
class Box<out T>(val value: T) {
    fun <R> map(func: (T) -> R): Box<R> = Box(func(value))
    fun <R> flatMap(func: (T) -> Box<R>) = func(value)
}
jvmMain/Bag.kt
Copy code
class Bag<out T>(val value: T) {
    fun <R> map(func: (T) -> R): Bag<R> = Bag(func(value))
    fun <R> flatMap(func: (T) -> Bag<R>): Bag<R> = func(value)
}
jvmTest/java
Copy code
(new Bag(4)).map(it -> "String").flatMap(str -> new Bag(5)); // passes with no problems at all
(new Box(1)).map(it -> "String").flatMap(str -> new Box(4)); // Function1<? super T, ? extends R> is not a functional interface
a
Can you please create a YouTrack issue with a sample project attached?