Files
swift-mirror/test/Interpreter/conversions.swift
Joe Groff 637c4e8171 Fold Interpreter and Interpreter/SIL tests.
There is only SIL. No reason to keep a subdirectory around.

Swift SVN r6029
2013-07-05 23:11:44 +00:00

17 lines
367 B
Swift

// RUN: %swift -i %s | FileCheck %s
class B { func foo() { println("foo") } }
class D : B { func bar() { println("bar") } }
class G<T> : B { func bas() { println("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<Int>).bas() }
up(D())
down(D())
down_generic(G<Int>())