File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %target-run-simple-swift(%S/Inputs/print.swift -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck %s
2
+
3
+ // REQUIRES: executable_test
4
+ // REQUIRES: optimized_stdlib
5
+ // REQUIRES: VENDOR=apple
6
+ // REQUIRES: OS=macosx
7
+
8
+ @main
9
+ struct Main {
10
+ static func main( ) {
11
+ let array : [ MyClass ] = [ MyClass ( ) , MySubclass ( ) ]
12
+ for e in array {
13
+ e. method ( )
14
+ }
15
+ }
16
+ }
17
+
18
+ class MyClass {
19
+ func method( ) { Self . foo ( ) }
20
+
21
+ class func foo( ) { print ( " MyClass.foo " ) }
22
+ }
23
+
24
+ class MySubclass : MyClass {
25
+
26
+ override class func foo( ) { print ( " MySubclass.foo " ) }
27
+ }
28
+
29
+ // CHECK: MyClass.foo
30
+ // CHECK: MySubclass.foo
You can’t perform that action at this time.
0 commit comments