Files
kotlin-fork/idea/idea-completion/testData/weighers/basic/KT-25588_2.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

32 lines
497 B
Kotlin
Vendored

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