Alexander Maryanovsky
05/31/2022, 9:34 AMAlexander Maryanovsky
05/31/2022, 9:39 AMString
in the middle of the builder block, because I may add some other type later?Alexander Maryanovsky
05/31/2022, 9:41 AMval l = buildList {
add("Hello")
val s = get(0)
s.
}
with the caret after the dot, IntelliJ suggests to insert length
but then says unresolved reference.
It does think the type of s
is String
ephemient
05/31/2022, 9:44 AMAlexander Maryanovsky
05/31/2022, 9:45 AMAlexander Maryanovsky
05/31/2022, 9:46 AMephemient
05/31/2022, 9:49 AM@BuilderInference
limitation. it only analyzes the type of the lambda after it has been processedAlexander Maryanovsky
05/31/2022, 10:04 AM