// RUN: %target-run-simple-swift | %FileCheck %s // REQUIRES: executable_test class B { func foo() { print("foo") } } class D : B { func bar() { print("bar") } } class G : B { func bas() { print("bas") } } // CHECK: foo func up(_ d: D) { d.foo() } // CHECK: bar func down(_ b: B) { (b as! D).bar() } // CHECK: bas func down_generic(_ b: B) { (b as! G).bas() } up(D()) down(D()) down_generic(G())