mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Fix SAM wrapper generation in secondary constructor calls
Should simply invoke 'checkSamCall' in corresponding visitor method to check if call arguments should be wrapped.
This commit is contained in:
24
compiler/testData/codegen/boxAgainstJava/sam/adapters/superInSecondaryConstructor.kt
vendored
Normal file
24
compiler/testData/codegen/boxAgainstJava/sam/adapters/superInSecondaryConstructor.kt
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// FILE: test.kt
|
||||
class Test : Base {
|
||||
constructor(f: () -> String) : super(f)
|
||||
}
|
||||
|
||||
fun box() = Test({ "OK" }).get()
|
||||
|
||||
// FILE: Supplier.java
|
||||
public interface Supplier<T> {
|
||||
T get();
|
||||
}
|
||||
|
||||
// FILE: Base.java
|
||||
public class Base {
|
||||
private final Supplier<String> supplier;
|
||||
|
||||
public Base(Supplier<String> supplier) {
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public String get() {
|
||||
return supplier.get();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user