Merge pull request #9213 from smowton/smowton/fix/inherited-single-abstract-method

Kotlin: fix implementation of SAM classes that inherit their abstract method
This commit is contained in:
Chris Smowton
2022-05-24 18:22:55 +01:00
committed by GitHub
4 changed files with 33 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
| test.kt:0:0:0:0 | TestKt | test.kt:3:1:3:35 | f |
| test.kt:0:0:0:0 | TestKt | test.kt:5:1:9:1 | test |
| test.kt:7:5:7:12 | new Function1<String,String>(...) { ... } | test.kt:7:5:7:12 | invoke |
| test.kt:7:5:7:12 | new UnaryOperator<String>(...) { ... } | test.kt:7:5:7:12 | apply |

View File

@@ -0,0 +1,9 @@
import java.util.function.UnaryOperator
fun f(x: UnaryOperator<String>) { }
fun test() {
f({x -> x})
}

View File

@@ -0,0 +1,5 @@
import java
from ClassOrInterface ci
where ci.fromSource()
select ci, ci.getAMethod()