Files
swift-mirror/test/Serialization/opaque_cross_file.swift
Joe Groff 8bd2319530 IRGen: Peephole metadata requests for opaque types.
If we're allowed to know at IRGen time what the underlying type of an opaque type is, we can
satisfy references to the opaque type's metadata or protocol witness tables by directly referencing
the underlying type instead.
2019-08-07 19:57:04 -07:00

19 lines
814 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -enable-implicit-dynamic -disable-availability-checking -emit-module-path %t/OpaqueCrossFileB.swiftmodule -module-name OpaqueCrossFileB %S/Inputs/OpaqueCrossFileB.swift
// RUN: %target-swift-frontend -enable-implicit-dynamic -disable-availability-checking -I %t -emit-ir -verify %s | %FileCheck %s
import OpaqueCrossFileB
dump(anyFoo())
dump(anyFooProp)
dump(Subscript()[])
public struct UsesAdapterMethod: Foo {
// Ensure that the mangling of the result type of adaptFoo correctly captures
// both the Self type and the parameter type.
// CHECK: @"symbolic _____y______SdQo_ 16OpaqueCrossFileB3FooPAAE8identityyQrqd__lFQO 17opaque_cross_file17UsesAdapterMethodV" =
public func adaptFoo(_ d: Double) -> some Foo {
return identity(d)
}
}