as opposed to ``` val suggested = avai//... val fo...
# language-proposals
g
as opposed to
Copy code
val suggested = avai//...
val footer = if(suggested != null) "things with $suggested" else ""
val nlsvars = "available vars:" + avialableVars.fold{ "\n\t$it" } //or {accum, next -> "$accum\n\t$next" } or one of the many utils to do this.
reportSemanticError("unable to do stuff,$footer$nlsvars)
or
Copy code
val suggested = avai//...
reportSemanticError(stringBuilder{
  append("unable to do stuff")
  appendIf(suggested != null) { "did you mean $suggested?" }
  append("available variables:")
  appendFold(availableVars) { "\n\t$it" }
})