title: How to return from Kotlin function type
body: <p>I'm using function type to store code to be invoked on button click.<br>
  How to return from this function type<br>
  Code given below :  </p>
  
  <pre><code>var SearchClickEvent: ((searchString: String) -&gt; Unit)? = null
  
  inputDialog!!.SearchClickEvent = Search_Click  
  
  private val Search_Click = { searchString: String -&gt;
      if(searchString.isEmpty()){
          return//Error msg : return is not allowed here  
          //How to return from here
      }
  }
  </code></pre>
  
  <p><strong>NOTE:</strong> I'm storing a piece of code in a variable not calling or writing any function</p>