Files
swift-mirror/test/multifile/outlined-thunks.swift
Slava Pestov 39a65abf85 IRGen: Outlined thunks don't need to receive fixed-size metadata
They're not used inside the thunk so it's a waste passing them in, and
if they involve private types from a different translation unit we will
get a linking error from referencing the metadata accessor function.

Fixes the test case in <rdar://problem/39470607>, but the more general
problem remains.
2018-04-17 16:11:21 -07:00

19 lines
506 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -emit-library -module-name outlined_thunks %S/Inputs/outlined-thunks-other.swift %s
// RUN: %target-build-swift -emit-library -module-name outlined_thunks -whole-module-optimization %S/Inputs/outlined-thunks-other.swift %s
// rdar://problem/39470607
protocol P { }
private struct MyPrivate<T: P> {
private var otherHelper: OtherInternal<T>? = nil
init(_: T) { }
}
extension P {
func foo(data: Any) {
_ = MyPrivate(data as! Self)
}
}