title: Immutable val null check inside extension function
body: <p>When I have an immutable val optional, the compiler tracks the information about the check I performed for null and can treat the variable as non null and call it directly inside the if condition.</p>
  
  <pre><code>val s: String? = "test"
  
  if (s != null) {
     s.startsWith("3") // This works
  }
  
  if (!s.isNullOrEmpty()) {
      s.startsWith("3") // Not working
  }
  </code></pre>
  
  <p>Is it possible to make that check in an extension function and keep the compiler aware of it?</p>