Add tests for SAM conversions

Add tests for KT-45191 [JPS] Marking method as "default" in Java SAM interface doesn't affect dependencies, which was fixed in intlellij(212): cbad0d91 support kotlin-generated lambda usage

#KT-45191 Fixed
This commit is contained in:
Aleksei.Cherepanov
2021-04-16 20:51:23 +03:00
parent 81a5ae7780
commit b5ef6c9316
10 changed files with 112 additions and 0 deletions
@@ -0,0 +1,3 @@
public interface SamInterface {
void run();
}
@@ -0,0 +1,3 @@
public interface SamInterface {
default void run() {}
}
@@ -0,0 +1,26 @@
================ Step #1 =================
Cleaning output files:
out/production/module/SamInterface.class
End of files
Exit code: NOTHING_DONE
------------------------------------------
Compiling files:
src/SamInterface.java
End of files
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/UsageWithFunctionExpressionKt$sam$SamInterface$0.class
out/production/module/UsageWithFunctionExpressionKt$usageWithFunctionExpression$a$1.class
out/production/module/UsageWithFunctionExpressionKt.class
out/production/module/UsageWithFunctionLiteralKt.class
End of files
Compiling files:
src/usageWithFunctionExpression.kt
src/usageWithFunctionLiteral.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Interface SamInterface does not have constructors
Interface SamInterface does not have constructors
@@ -0,0 +1,4 @@
fun usageWithFunctionExpression() {
val a = { println("Hi!") }
SamInterface(a)
}
@@ -0,0 +1,3 @@
fun usageWithFunctionLiteral() {
SamInterface { println("Hi!") }
}