File tree Expand file tree Collapse file tree 4 files changed +37
-3
lines changed Expand file tree Collapse file tree 4 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -831,9 +831,11 @@ std::string ASTMangler::mangleOpaqueTypeDecl(const OpaqueTypeDecl *decl) {
831831}
832832
833833std::string ASTMangler::mangleOpaqueTypeDecl (const ValueDecl *decl) {
834- DWARFMangling = true ;
835834 OptimizeProtocolNames = false ;
836- return mangleDeclAsUSR (decl, MANGLING_PREFIX_STR);
835+
836+ beginMangling ();
837+ appendEntity (decl);
838+ return finalize ();
837839}
838840
839841std::string ASTMangler::mangleGenericSignature (const GenericSignature sig) {
Original file line number Diff line number Diff line change @@ -2943,7 +2943,9 @@ TypeRepr *ValueDecl::getOpaqueResultTypeRepr() const {
29432943
29442944OpaqueTypeDecl *ValueDecl::getOpaqueResultTypeDecl () const {
29452945 if (getOpaqueResultTypeRepr () == nullptr ) {
2946- if (isa<ModuleDecl>(this ))
2946+ if (!isa<VarDecl>(this ) &&
2947+ !isa<FuncDecl>(this ) &&
2948+ !isa<SubscriptDecl>(this ))
29472949 return nullptr ;
29482950 auto file = cast<FileUnit>(getDeclContext ()->getModuleScopeContext ());
29492951 // Don't look up when the decl is from source, otherwise a cycle will happen.
Original file line number Diff line number Diff line change 1+ @available ( macOS 10 . 8 , * )
2+ @_originallyDefinedIn ( module: " CoreSoup " , macOS 10 . 10 )
3+ public struct Vegetable {
4+ public init ( ) { }
5+ }
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+
3+ // 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
4+ // 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
5+
6+ // RUN: %FileCheck %s < %t/CoreChef.swiftinterface
7+
8+ // REQUIRES: OS=macosx
9+ import CoreVegetable
10+
11+ public protocol Soup { }
12+
13+ public struct VegetableSoup : Soup { }
14+
15+ public protocol Chef {
16+ associatedtype Food
17+
18+ func cookSoup( _: Vegetable ) -> Food
19+ }
20+
21+ public struct SoupChef : Chef {
22+ public func cookSoup( _: Vegetable ) -> some Soup { VegetableSoup ( ) }
23+ }
24+
25+ // CHECK-LABEL: public typealias Food = @_opaqueReturnTypeOf("$s8CoreChef04SoupB0V04cookC0yQr0aC09VegetableVF", 0) __
You can’t perform that action at this time.
0 commit comments