Files
swift-mirror/test/Interpreter/SDK/Cocoa_repl.swift
Joe Groff 773eadb9f2 IRGen/Runtime: Populate the runtime protocol conformance table with relative references.
By using relative references, either directly to symbols internal to the current TU, or to the GOT entry for external symbols, we avoid unnecessary runtime relocations, and we save space on 64-bit platforms, since a single image is still <2GB in size. For the 64-bit standard library, this trades 26KB of fake-const data in __DATA,__swift1_proto for 13KB of true-const data in __TEXT,__swift2_proto. Implements rdar://problem/22334380.

Swift SVN r31555
2015-08-28 18:07:22 +00:00

21 lines
325 B
Swift

// RUN: %target-repl-run-simple-swift | FileCheck %s
// REQUIRES: objc_interop
// REQUIRES: swift_repl
import Cocoa
// CHECK: 0{{$}}
print(NSNumber(integer: 0).description)
protocol Q { func foo() }
extension CGRect: Q {
func foo() {
print(self)
}
}
(CGRect() as Any as! Q).foo()
// CHECK: (0.0, 0.0, 0.0, 0.0)