This is javap result of .class of kotlin code. So ...
# getting-started
s
This is javap result of .class of kotlin code. So the invoke method returning java.lang.Object is marked as synthetic and bridge method that's why is it possible to have two methods with same name but different return type. At source code it's not possible but in byte code by manually generating byte code using some byte code generator can we do that?
e
Copy code
val c = Supplier<Int> { 1 } // Kotlin
Supplier<Integer> c = () -> 1; // Java
both should generate similar synthetic bridge methods
https://docs.oracle.com/javase/tutorial/java/generics/bridgeMethods.html
When compiling a class or interface that extends a parameterized class or implements a parameterized interface, the compiler may need to create a synthetic method, which is called a bridge method, as part of the type erasure process.