Files
swift-mirror/test/ModuleInterface/originally-defined-attr-opaque-result.swift
Slava Pestov fa570fe072 ASTMangler: Respect @_originallyDefinedIn in mangleOpaqueTypeDecl()
mangleOpaqueTypeDecl() used to enable DWARFMangling, which
ignores @_originallyDefinedIn, which would in turn break module
interfaces.

Fixes rdar://problem/86480663.
2022-01-06 23:44:14 -05:00

26 lines
916 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path %t/CoreVegetable.swiftinterface %S/Inputs/CoreVegetable.swift -disable-availability-checking -enable-library-evolution -swift-version 5
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path %t/CoreChef.swiftinterface -module-name CoreChef %s -I %t -disable-availability-checking -enable-library-evolution -swift-version 5 -DLIB
// RUN: %FileCheck %s < %t/CoreChef.swiftinterface
// REQUIRES: OS=macosx
import CoreVegetable
public protocol Soup {}
public struct VegetableSoup : Soup {}
public protocol Chef {
associatedtype Food
func cookSoup(_: Vegetable) -> Food
}
public struct SoupChef : Chef {
public func cookSoup(_: Vegetable) -> some Soup { VegetableSoup() }
}
// CHECK-LABEL: public typealias Food = @_opaqueReturnTypeOf("$s8CoreChef04SoupB0V04cookC0yQr0aC09VegetableVF", 0) __