mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 00:21:35 +00:00
[NI] Introduce feature for passing function references with defaults
Relates to KT-8834, we continue reducing differences between old and new inference. Note that as for `SamConversionPerArgument`, this feature is enabled in the compiler and not in the IDE to avoid breaking code for those users that already enabled new inference in the compiler
This commit is contained in:
11
compiler/testData/cli/jvm/functionReferenceWithDefaultValuesFeatureIsEnabledWithNewInference.kt
vendored
Normal file
11
compiler/testData/cli/jvm/functionReferenceWithDefaultValuesFeatureIsEnabledWithNewInference.kt
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
fun foo(a: String, b: Int = 5): String {
|
||||
return a + b
|
||||
}
|
||||
|
||||
fun bar1(body: (String) -> String): String {
|
||||
return body("something")
|
||||
}
|
||||
|
||||
fun test() {
|
||||
bar1(::foo)
|
||||
}
|
||||
Reference in New Issue
Block a user