Files
kotlin-fork/idea/idea-completion/testData/weighers/basic/KT-25588_1.kts
T
Pavel V. Talanov 0c1d25d5ac Completion: when Unit is expected do not prioritize by return type
Decide on completion order by other factors
Previously would prefer callable that return Unit if Unit is the expected type
    leading to strange completion order

 #KT-25588 Fixed
2018-08-16 13:59:38 +02:00

31 lines
492 B
Kotlin
Vendored

// RUNTIME_WITH_SCRIPT_RUNTIME
@DslMarker
annotation class MyDsl
project1 {
<caret>
}
@MyDsl
fun project1(p: Project.() -> Unit) {
Project(p)
}
@MyDsl
fun project2(p: Project.() -> Unit): Project {
return Project(p)
}
@MyDsl
fun Project.buildType(init: BuildType.() -> Unit): BuildType {
return BuildType(this, init)
}
@MyDsl
class Project(init: Project.() -> Unit)
@MyDsl
class BuildType(p: Project, init: BuildType.() -> Unit)
// ORDER: buildType, project1, project2