hephaestus-compiler-project / hephaestus

A framework for testing compilers' type checkers
https://hephaestus-compiler-project.github.io/
GNU General Public License v3.0
49 stars 10 forks source link

enhancement: in certain cases permit smart casts for parameterized types #21

Closed theosotr closed 3 years ago

theosotr commented 3 years ago

Example:

open class In<T>
class Child<T> : In<T>()

fun test(t: In<String>) {
    if (t is Child) {
        val child: Child<String> = t
    }
}