When trying to compile a Java @FunctionalInterface
having more than 1 non-abstract method a compilation error is raised.
However, when doing the same in Kotlin, no errors or warnings are raised, i.e. the following Kotlin interface
compiles successfully:
@FunctionalInterface
interface Foo {
fun foo()
fun foo(params: Map<String, String>)
}
Is this the intended behaviour or a bug in the Kotlin compiler?
Please note that the generated bytecode for the above Kotlin snippet is equivalent to the following Java snippet (which – correctly – doesn't compile):
@FunctionalInterface
// metadata omitted
public interface Foo {
void foo();
void foo(@NotNull Map var1);
}