Problems with Kotlin
OK, this seems like a major fail on behalf of the Kotlin developer team:<p><pre><code>    var value : Int? = null

    fun F() : Int {
      if ( value != null ) return 0
      return value &#x2F;&#x2F; error
    }
</code></pre>
Tracing value types through a function is a solved problem. Look at TypeScript: Almost the exact function above will work flawlessly. [1]<p>Sure something in a JVM could be changed by another thread. But that would really be a bug no matter how you slice it. Doing type analysis like this seems like a minimal requirement for a modern language.<p>[1] <a href="http:&#x2F;&#x2F;imgur.com&#x2F;nxdN9vc" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;nxdN9vc</a> -- you can see that TypeScript can identify the remaining type. It works for optional null as well when strictNullChecks is enabled.