Tests with SAM conversions.

This commit is contained in:
Evgeny Gerashchenko
2014-10-24 16:28:32 +04:00
parent 3237791433
commit 21105fcae4
13 changed files with 97 additions and 1 deletions
@@ -0,0 +1,3 @@
public interface SamInterface {
Object run();
}
@@ -0,0 +1,4 @@
public interface SamInterface {
Object run();
Object walk();
}
@@ -0,0 +1,23 @@
Cleaning output files:
out/production/module/SamInterface.class
End of files
Compiling files:
src/SamInterface.java
End of files
Cleaning output files:
out/production/module/_DefaultPackage$sam$SamInterface$*.class
out/production/module/_DefaultPackage$usageWithFunctionExpression$*$usageWithFunctionExpression$a$1.class
out/production/module/_DefaultPackage$usageWithFunctionExpression$*.class
out/production/module/_DefaultPackage$usageWithFunctionLiteral$*$usageWithFunctionLiteral$1.class
out/production/module/_DefaultPackage$usageWithFunctionLiteral$*.class
out/production/module/_DefaultPackage.class
End of files
Compiling files:
src/usageWithFunctionExpression.kt
src/usageWithFunctionLiteral.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Expression 'SamInterface' cannot be invoked as a function. The function invoke() is not found
Kotlin:ERROR:Please specify constructor invocation; classifier 'SamInterface' does not have a class object
Kotlin:ERROR:Expression 'SamInterface' cannot be invoked as a function. The function invoke() is not found
Kotlin:ERROR:Please specify constructor invocation; classifier 'SamInterface' does not have a class object
@@ -0,0 +1,3 @@
fun notUsage() {
println("!")
}
@@ -0,0 +1,4 @@
fun usageWithFunctionExpression() {
val a = { ":)" }
SamInterface(a)
}
@@ -0,0 +1,3 @@
fun usageWithFunctionLiteral() {
SamInterface { ":)" }
}