[FIR] Bind return expression to function symbol instead of function itself
This commit is contained in:
committed by
TeamCityServer
parent
245bc7c8e2
commit
714c2a8f93
@@ -0,0 +1,20 @@
|
||||
class ASTNode
|
||||
class Wrap(val message: String)
|
||||
|
||||
typealias WrappingStrategy = (childElement: ASTNode) -> Wrap?
|
||||
|
||||
fun getWrappingStrategy(): WrappingStrategy {
|
||||
return wrap@{ childElement ->
|
||||
Wrap("OK").let {
|
||||
return@wrap it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getWrapAfterAnnotation(childElement: ASTNode): Wrap? {
|
||||
return Wrap("OK")
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return getWrappingStrategy().invoke(ASTNode())?.message ?: "fail"
|
||||
}
|
||||
Reference in New Issue
Block a user