Skip to content

Commit 81f4b90

Browse files
author
Harlan Haskins
authored
Merge pull request #25488 from harlanhaskins/property-reprs-5.1
[5.1] [ModuleInterface] Qualify all types in module interfaces
2 parents c938293 + ed62e24 commit 81f4b90

32 files changed

+303
-202
lines changed

include/swift/AST/PrintOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ struct PrintOptions {
494494
/// consistent and well-formed.
495495
///
496496
/// \see swift::emitParseableInterface
497-
static PrintOptions printParseableInterfaceFile();
497+
static PrintOptions printParseableInterfaceFile(bool preferTypeRepr);
498498

499499
static PrintOptions printModuleInterface();
500500
static PrintOptions printTypeInterface(Type T);

include/swift/Frontend/ParseableInterfaceSupport.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class ModuleDecl;
2727

2828
/// Options for controlling the generation of the .swiftinterface output.
2929
struct ParseableInterfaceOptions {
30+
/// Should we prefer printing TypeReprs when writing out types in a module
31+
/// interface, or should we fully-qualify them?
32+
bool PreserveTypesAsWritten = false;
33+
3034
/// Copy of all the command-line flags passed at .swiftinterface
3135
/// generation time, re-applied to CompilerInvocation when reading
3236
/// back .swiftinterface and reconstructing .swiftmodule.

include/swift/Option/FrontendOptions.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,11 @@ def build_module_from_parseable_interface :
534534
Alias<compile_module_from_interface>,
535535
ModeOpt;
536536

537+
def module_interface_preserve_types_as_written :
538+
Flag<["-"], "module-interface-preserve-types-as-written">,
539+
HelpText<"When emitting a module interface, preserve types as they were "
540+
"written in the source">;
541+
537542
def prebuilt_module_cache_path :
538543
Separate<["-"], "prebuilt-module-cache-path">,
539544
HelpText<"Directory of prebuilt modules for loading module interfaces">;

lib/AST/ASTPrinter.cpp

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static bool contributesToParentTypeStorage(const AbstractStorageDecl *ASD) {
9494
return !ND->isResilient() && ASD->hasStorage() && !ASD->isStatic();
9595
}
9696

97-
PrintOptions PrintOptions::printParseableInterfaceFile() {
97+
PrintOptions PrintOptions::printParseableInterfaceFile(bool preferTypeRepr) {
9898
PrintOptions result;
9999
result.PrintLongAttrsOnSeparateLines = true;
100100
result.TypeDefinitions = true;
@@ -110,6 +110,7 @@ PrintOptions PrintOptions::printParseableInterfaceFile() {
110110
result.EnumRawValues = EnumRawValueMode::PrintObjCOnly;
111111
result.OpaqueReturnTypePrinting =
112112
OpaqueReturnTypePrintingMode::StableReference;
113+
result.PreferTypeRepr = preferTypeRepr;
113114

114115
// We should print __consuming, __owned, etc for the module interface file.
115116
result.SkipUnderscoredKeywords = false;
@@ -990,7 +991,18 @@ void PrintAST::printAttributes(const Decl *D) {
990991
void PrintAST::printTypedPattern(const TypedPattern *TP) {
991992
printPattern(TP->getSubPattern());
992993
Printer << ": ";
993-
printTypeLoc(TP->getTypeLoc());
994+
995+
// Make sure to check if the underlying var decl is an implicitly unwrapped
996+
// optional.
997+
bool isIUO = false;
998+
if (auto *named = dyn_cast<NamedPattern>(TP->getSubPattern()))
999+
if (auto decl = named->getDecl())
1000+
isIUO = decl->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>();
1001+
1002+
if (isIUO)
1003+
printTypeLocForImplicitlyUnwrappedOptional(TP->getTypeLoc());
1004+
else
1005+
printTypeLoc(TP->getTypeLoc());
9941006
}
9951007

9961008
/// Determines if we are required to print the name of a property declaration,
@@ -2538,6 +2550,14 @@ void PrintAST::visitVarDecl(VarDecl *decl) {
25382550
tyLoc = TypeLoc::withoutLoc(decl->getInterfaceType());
25392551

25402552
Printer.printDeclResultTypePre(decl, tyLoc);
2553+
2554+
// HACK: When printing result types for vars with opaque result types,
2555+
// always print them using the `some` keyword instead of printing
2556+
// the full stable reference.
2557+
llvm::SaveAndRestore<PrintOptions::OpaqueReturnTypePrintingMode>
2558+
x(Options.OpaqueReturnTypePrinting,
2559+
PrintOptions::OpaqueReturnTypePrintingMode::WithOpaqueKeyword);
2560+
25412561
if (decl->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>())
25422562
printTypeLocForImplicitlyUnwrappedOptional(tyLoc);
25432563
else
@@ -2813,6 +2833,14 @@ void PrintAST::visitFuncDecl(FuncDecl *decl) {
28132833

28142834
Printer.printDeclResultTypePre(decl, ResultTyLoc);
28152835
Printer.callPrintStructurePre(PrintStructureKind::FunctionReturnType);
2836+
2837+
// HACK: When printing result types for funcs with opaque result types,
2838+
// always print them using the `some` keyword instead of printing
2839+
// the full stable reference.
2840+
llvm::SaveAndRestore<PrintOptions::OpaqueReturnTypePrintingMode>
2841+
x(Options.OpaqueReturnTypePrinting,
2842+
PrintOptions::OpaqueReturnTypePrintingMode::WithOpaqueKeyword);
2843+
28162844
if (decl->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>())
28172845
printTypeLocForImplicitlyUnwrappedOptional(ResultTyLoc);
28182846
else
@@ -2955,6 +2983,14 @@ void PrintAST::visitSubscriptDecl(SubscriptDecl *decl) {
29552983
Printer.callPrintStructurePre(PrintStructureKind::FunctionReturnType);
29562984
if (!elementTy.getTypeRepr())
29572985
elementTy = TypeLoc::withoutLoc(decl->getElementInterfaceType());
2986+
2987+
// HACK: When printing result types for subscripts with opaque result types,
2988+
// always print them using the `some` keyword instead of printing
2989+
// the full stable reference.
2990+
llvm::SaveAndRestore<PrintOptions::OpaqueReturnTypePrintingMode>
2991+
x(Options.OpaqueReturnTypePrinting,
2992+
PrintOptions::OpaqueReturnTypePrintingMode::WithOpaqueKeyword);
2993+
29582994
if (decl->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>())
29592995
printTypeLocForImplicitlyUnwrappedOptional(elementTy);
29602996
else

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,16 +2046,8 @@ TypeDecl *EquivalenceClass::lookupNestedType(
20462046
continue;
20472047
}
20482048

2049-
// If this is another type declaration, determine whether we should
2050-
// record it.
2049+
// If this is another type declaration, record it.
20512050
if (auto type = dyn_cast<TypeDecl>(member)) {
2052-
// FIXME: Filter out type declarations that aren't in the same
2053-
// module as the protocol itself. This is an unprincipled hack, but
2054-
// provides consistent lookup semantics for the generic signature
2055-
// builder in all contents.
2056-
if (type->getDeclContext()->getParentModule()
2057-
!= proto->getParentModule())
2058-
continue;
20592051

20602052
// Resolve the signature of this type.
20612053
if (!type->hasInterfaceType()) {

lib/Frontend/CompilerInvocation.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,14 @@ static void PrintArg(raw_ostream &OS, const char *Arg, StringRef TempDir) {
199199
OS << '"';
200200
}
201201

202+
static void ParseParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
203+
ArgList &Args) {
204+
using namespace options;
205+
206+
Opts.PreserveTypesAsWritten |=
207+
Args.hasArg(OPT_module_interface_preserve_types_as_written);
208+
}
209+
202210
/// Save a copy of any flags marked as ModuleInterfaceOption, if running
203211
/// in a mode that is going to emit a .swiftinterface file.
204212
static void SaveParseableInterfaceArgs(ParseableInterfaceOptions &Opts,
@@ -1300,6 +1308,7 @@ bool CompilerInvocation::parseArgs(
13001308
return true;
13011309
}
13021310

1311+
ParseParseableInterfaceArgs(ParseableInterfaceOpts, ParsedArgs);
13031312
SaveParseableInterfaceArgs(ParseableInterfaceOpts, FrontendOpts,
13041313
ParsedArgs, Diags);
13051314

lib/Frontend/ParseableInterfaceSupport.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ bool swift::emitParseableInterface(raw_ostream &out,
411411
printToolVersionAndFlagsComment(out, Opts, M);
412412
printImports(out, M);
413413

414-
const PrintOptions printOptions = PrintOptions::printParseableInterfaceFile();
414+
const PrintOptions printOptions = PrintOptions::printParseableInterfaceFile(
415+
Opts.PreserveTypesAsWritten);
415416
InheritedProtocolCollector::PerTypeMap inheritedProtocolMap;
416417

417418
SmallVector<Decl *, 16> topLevelDecls;

stdlib/public/Darwin/XCTest/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ add_swift_target_library(swiftXCTest ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS
77
XCTestCaseAdditions.mm
88
XCTest.swift
99

10-
SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
10+
SWIFT_COMPILE_FLAGS
11+
"${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
12+
13+
# XCTest has a type called XCTest, which exposes an issue in module
14+
# interfaces -- because types are fully-qualified, the compiler currently
15+
# doesn't disambiguate between XCTest-the-module and XCTest-the-class.
16+
# rdar://48445154
17+
-Xfrontend -module-interface-preserve-types-as-written
1118
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
1219
TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR
1320
SWIFT_MODULE_DEPENDS ObjectiveC Foundation
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public protocol AnExternalProtocol {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %target-swift-frontend -emit-module-path %t/ExternalProtocol.swiftmodule %S/Inputs/external-protocol.swift -module-name ExternalProtocol
4+
// RUN: %target-swift-frontend -typecheck -I %t %s
5+
6+
import ExternalProtocol
7+
8+
extension AnExternalProtocol {
9+
typealias TypeAlias = Int
10+
11+
func methodUsingAlias(_ alias: Self.TypeAlias) {}
12+
}

test/ParseableInterface/Inputs/enums-layout-helper.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// CHECK-LABEL: public enum FutureproofEnum : Int
1+
// CHECK-LABEL: public enum FutureproofEnum : Swift.Int
22
public enum FutureproofEnum: Int {
33
// CHECK-NEXT: case a{{$}}
44
case a = 1
@@ -8,7 +8,7 @@ public enum FutureproofEnum: Int {
88
case c = 100
99
}
1010

11-
// CHECK-LABEL: public enum FrozenEnum : Int
11+
// CHECK-LABEL: public enum FrozenEnum : Swift.Int
1212
@_frozen public enum FrozenEnum: Int {
1313
// CHECK-NEXT: case a{{$}}
1414
case a = 1
@@ -18,7 +18,7 @@ public enum FutureproofEnum: Int {
1818
case c = 100
1919
}
2020

21-
// CHECK-LABEL: public enum FutureproofObjCEnum : Int
21+
// CHECK-LABEL: public enum FutureproofObjCEnum : Swift.Int
2222
@objc public enum FutureproofObjCEnum: Int {
2323
// CHECK-NEXT: case a = 1{{$}}
2424
case a = 1
@@ -28,7 +28,7 @@ public enum FutureproofEnum: Int {
2828
case c = 100
2929
}
3030

31-
// CHECK-LABEL: public enum FrozenObjCEnum : Int
31+
// CHECK-LABEL: public enum FrozenObjCEnum : Swift.Int
3232
@_frozen @objc public enum FrozenObjCEnum: Int {
3333
// CHECK-NEXT: case a = 1{{$}}
3434
case a = 1
@@ -37,4 +37,3 @@ public enum FutureproofEnum: Int {
3737
// CHECK-NEXT: case c = 100{{$}}
3838
case c = 100
3939
}
40-

test/ParseableInterface/ModuleCache/swiftdoc-next-to-swiftinterface.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend -emit-module -emit-parseable-module-interface-path %t/Lib.swiftinterface -emit-module-doc -parse-stdlib -o %t/Lib.swiftmodule %s
3-
// RUN: %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x > %t/from-module.txt
3+
// RUN: %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x -prefer-type-repr=false -fully-qualified-types=true > %t/from-module.txt
44
// RUN: %FileCheck %s < %t/from-module.txt
55

66
// RUN: rm %t/Lib.swiftmodule
7-
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x > %t/from-interface.txt
7+
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x -prefer-type-repr=false -fully-qualified-types=true > %t/from-interface.txt
88
// RUN: diff %t/from-module.txt %t/from-interface.txt
99

1010
// Try again with architecture-specific subdirectories.
1111
// RUN: %empty-directory(%t)
1212
// RUN: %empty-directory(%t/Lib.swiftmodule)
1313
// RUN: %target-swift-frontend -emit-module -emit-parseable-module-interface-path %t/Lib.swiftmodule/%target-cpu.swiftinterface -emit-module-doc -parse-stdlib -o %t/Lib.swiftmodule/%target-swiftmodule-name -module-name Lib %s
14-
// RUN: %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x > %t/from-module.txt
14+
// RUN: %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x -prefer-type-repr=false -fully-qualified-types=true > %t/from-module.txt
1515
// RUN: %FileCheck %s < %t/from-module.txt
1616

1717
// RUN: rm %t/Lib.swiftmodule/%target-swiftmodule-name
18-
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x > %t/from-interface.txt
18+
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x -prefer-type-repr=false -fully-qualified-types=true > %t/from-interface.txt
1919
// RUN: diff %t/from-module.txt %t/from-interface.txt
2020

2121
/// Very important documentation!

test/ParseableInterface/access-filter.swift

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -typecheck -emit-parseable-module-interface-path %t.swiftinterface %s
1+
// RUN: %target-swift-frontend -typecheck -emit-parseable-module-interface-path %t.swiftinterface %s -module-name AccessFilter
22
// RUN: %FileCheck %s < %t.swiftinterface
33
// RUN: %FileCheck -check-prefix NEGATIVE %s < %t.swiftinterface
44

@@ -109,7 +109,7 @@ extension UFIProto {
109109

110110
// CHECK: extension PublicStruct {{[{]$}}
111111
extension PublicStruct {
112-
// CHECK: @_hasInitialValue public static var secretlySettable: Int {
112+
// CHECK: @_hasInitialValue public static var secretlySettable: Swift.Int {
113113
// CHECK-NEXT: get
114114
// CHECK-NEXT: }
115115
public private(set) static var secretlySettable: Int = 0
@@ -120,7 +120,7 @@ extension InternalStruct_BAD: PublicProto {
120120
internal static var dummy: Int { return 0 }
121121
}
122122

123-
// CHECK: extension UFIStruct : PublicProto {{[{]$}}
123+
// CHECK: extension UFIStruct : AccessFilter.PublicProto {{[{]$}}
124124
extension UFIStruct: PublicProto {
125125
// CHECK-NEXT: @usableFromInline
126126
// CHECK-NEXT: internal typealias Assoc = Swift.Int
@@ -135,7 +135,7 @@ extension UFIStruct: PublicProto {
135135
public enum PublicEnum {
136136
// CHECK-NEXT: case x
137137
case x
138-
// CHECK-NEXT: case y(Int)
138+
// CHECK-NEXT: case y(Swift.Int)
139139
case y(Int)
140140
} // CHECK-NEXT: {{^[}]$}}
141141

@@ -148,7 +148,7 @@ enum InternalEnum_BAD {
148148
@usableFromInline enum UFIEnum {
149149
// CHECK-NEXT: case x
150150
case x
151-
// CHECK-NEXT: case y(Int)
151+
// CHECK-NEXT: case y(Swift.Int)
152152
case y(Int)
153153
} // CHECK-NEXT: {{^[}]$}}
154154

@@ -167,13 +167,13 @@ class InternalClass_BAD {
167167
// CHECK: public struct GenericStruct<T>
168168
public struct GenericStruct<T> {}
169169

170-
// CHECK: extension GenericStruct where T == main.PublicStruct {{[{]$}}
171-
extension GenericStruct where T == PublicStruct {
170+
// CHECK: extension GenericStruct where T == AccessFilter.PublicStruct {{[{]$}}
171+
extension GenericStruct where T == AccessFilter.PublicStruct {
172172
// CHECK-NEXT: public func constrainedToPublicStruct(){{$}}
173173
public func constrainedToPublicStruct() {}
174174
} // CHECK-NEXT: {{^[}]$}}
175-
// CHECK: extension GenericStruct where T == main.UFIStruct {{[{]$}}
176-
extension GenericStruct where T == UFIStruct {
175+
// CHECK: extension GenericStruct where T == AccessFilter.UFIStruct {{[{]$}}
176+
extension GenericStruct where T == AccessFilter.UFIStruct {
177177
// CHECK-NEXT: @usableFromInline{{$}}
178178
// CHECK-NEXT: internal func constrainedToUFIStruct(){{$}}
179179
@usableFromInline internal func constrainedToUFIStruct() {}
@@ -182,12 +182,12 @@ extension GenericStruct where T == InternalStruct_BAD {
182182
@usableFromInline internal func constrainedToInternalStruct_BAD() {}
183183
}
184184

185-
// CHECK: extension GenericStruct where T == main.PublicStruct {{[{]$}}
185+
// CHECK: extension GenericStruct where T == AccessFilter.PublicStruct {{[{]$}}
186186
extension GenericStruct where PublicStruct == T {
187187
// CHECK-NEXT: public func constrainedToPublicStruct2(){{$}}
188188
public func constrainedToPublicStruct2() {}
189189
} // CHECK-NEXT: {{^[}]$}}
190-
// CHECK: extension GenericStruct where T == main.UFIStruct {{[{]$}}
190+
// CHECK: extension GenericStruct where T == AccessFilter.UFIStruct {{[{]$}}
191191
extension GenericStruct where UFIStruct == T {
192192
// CHECK-NEXT: @usableFromInline{{$}}
193193
// CHECK-NEXT: internal func constrainedToUFIStruct2(){{$}}
@@ -197,12 +197,12 @@ extension GenericStruct where InternalStruct_BAD == T {
197197
@usableFromInline internal func constrainedToInternalStruct2_BAD() {}
198198
}
199199

200-
// CHECK: extension GenericStruct where T : main.PublicProto {{[{]$}}
200+
// CHECK: extension GenericStruct where T : AccessFilter.PublicProto {{[{]$}}
201201
extension GenericStruct where T: PublicProto {
202202
// CHECK-NEXT: public func constrainedToPublicProto(){{$}}
203203
public func constrainedToPublicProto() {}
204204
} // CHECK-NEXT: {{^[}]$}}
205-
// CHECK: extension GenericStruct where T : main.UFIProto {{[{]$}}
205+
// CHECK: extension GenericStruct where T : AccessFilter.UFIProto {{[{]$}}
206206
extension GenericStruct where T: UFIProto {
207207
// CHECK-NEXT: @usableFromInline{{$}}
208208
// CHECK-NEXT: internal func constrainedToUFIProto(){{$}}
@@ -212,12 +212,12 @@ extension GenericStruct where T: InternalProto_BAD {
212212
@usableFromInline internal func constrainedToInternalProto_BAD() {}
213213
}
214214

215-
// CHECK: extension GenericStruct where T : main.PublicClass {{[{]$}}
215+
// CHECK: extension GenericStruct where T : AccessFilter.PublicClass {{[{]$}}
216216
extension GenericStruct where T: PublicClass {
217217
// CHECK-NEXT: public func constrainedToPublicClass(){{$}}
218218
public func constrainedToPublicClass() {}
219219
} // CHECK-NEXT: {{^[}]$}}
220-
// CHECK: extension GenericStruct where T : main.UFIClass {{[{]$}}
220+
// CHECK: extension GenericStruct where T : AccessFilter.UFIClass {{[{]$}}
221221
extension GenericStruct where T: UFIClass {
222222
// CHECK-NEXT: @usableFromInline{{$}}
223223
// CHECK-NEXT: internal func constrainedToUFIClass(){{$}}
@@ -236,21 +236,21 @@ extension GenericStruct where T: AnyObject {
236236
public struct PublicAliasBase {}
237237
internal struct ReallyInternalAliasBase_BAD {}
238238

239-
// CHECK: public typealias PublicAlias = PublicAliasBase
239+
// CHECK: public typealias PublicAlias = AccessFilter.PublicAliasBase
240240
public typealias PublicAlias = PublicAliasBase
241241
internal typealias InternalAlias_BAD = PublicAliasBase
242242
// CHECK: @usableFromInline
243-
// CHECK-NEXT: internal typealias UFIAlias = PublicAliasBase
243+
// CHECK-NEXT: internal typealias UFIAlias = AccessFilter.PublicAliasBase
244244
@usableFromInline internal typealias UFIAlias = PublicAliasBase
245245

246246
internal typealias ReallyInternalAlias_BAD = ReallyInternalAliasBase_BAD
247247

248-
// CHECK: extension GenericStruct where T == main.PublicAlias {{[{]$}}
248+
// CHECK: extension GenericStruct where T == AccessFilter.PublicAlias {{[{]$}}
249249
extension GenericStruct where T == PublicAlias {
250250
// CHECK-NEXT: public func constrainedToPublicAlias(){{$}}
251251
public func constrainedToPublicAlias() {}
252252
} // CHECK-NEXT: {{^[}]$}}
253-
// CHECK: extension GenericStruct where T == main.UFIAlias {{[{]$}}
253+
// CHECK: extension GenericStruct where T == AccessFilter.UFIAlias {{[{]$}}
254254
extension GenericStruct where T == UFIAlias {
255255
// CHECK-NEXT: @usableFromInline{{$}}
256256
// CHECK-NEXT: internal func constrainedToUFIAlias(){{$}}
@@ -275,7 +275,7 @@ extension GenericStruct: PublicProto where T: InternalProto_BAD {
275275

276276
public struct MultiGenericStruct<First, Second> {}
277277

278-
// CHECK: extension MultiGenericStruct where First == main.PublicStruct, Second == main.PublicStruct {{[{]$}}
278+
// CHECK: extension MultiGenericStruct where First == AccessFilter.PublicStruct, Second == AccessFilter.PublicStruct {{[{]$}}
279279
extension MultiGenericStruct where First == PublicStruct, Second == PublicStruct {
280280
// CHECK-NEXT: public func publicPublic(){{$}}
281281
public func publicPublic() {}

0 commit comments

Comments
 (0)