Skip to content

Commit 8f466f7

Browse files
authored
Merge pull request #69560 from tshortli/module-interface-lazy-typecheck-qualified-global-actors
ModuleInterface: Resolve types of CustomAttrs when printing
2 parents 2b594b2 + 30a3927 commit 8f466f7

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

lib/AST/Attr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,9 +970,9 @@ bool DeclAttribute::printImpl(ASTPrinter &Printer, const PrintOptions &Options,
970970
break;
971971
}
972972
case DAK_Custom: {
973-
974973
auto attr = cast<CustomAttr>(this);
975-
if (auto type = attr->getType()) {
974+
if (auto type =
975+
D->getResolvedCustomAttrType(const_cast<CustomAttr *>(attr))) {
976976
// Print custom attributes only if the attribute decl is accessible.
977977
// FIXME: rdar://85477478 They should be rejected.
978978
if (auto attrDecl = type->getNominalOrBoundGenericNominal()) {

test/ModuleInterface/lazy-typecheck.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,16 @@
1515
// RUN: %target-swift-frontend -swift-version 5 %S/../Inputs/lazy_typecheck.swift -module-name lazy_typecheck -typecheck -emit-module-interface-path %t/lazy/lazy_typecheck.swiftinterface -enable-library-evolution -parse-as-library -package-name Package -DFLAG -debug-forbid-typecheck-prefix NoTypecheck -experimental-lazy-typecheck
1616
// RUN: rm -rf %t/lazy/*.swiftmodule
1717
// RUN: %target-swift-frontend -package-name ClientPackage -typecheck -verify %S/../Inputs/lazy_typecheck_client.swift -I %t/lazy
18-
// FIXME: The emitted interfaces should be identical
19-
// diff -u %t/baseline/lazy_typecheck.swiftinterface %t/lazy/lazy_typecheck.swiftinterface
18+
// RUN: diff -u %t/baseline/lazy_typecheck.swiftinterface %t/lazy/lazy_typecheck.swiftinterface
2019

2120
// (3) Same as (2), but with -experimental-skip-all-function-bodies added.
2221
// RUN: %target-swift-frontend -swift-version 5 %S/../Inputs/lazy_typecheck.swift -module-name lazy_typecheck -typecheck -emit-module-interface-path %t/lazy-skip-all/lazy_typecheck.swiftinterface -enable-library-evolution -parse-as-library -package-name Package -DFLAG -debug-forbid-typecheck-prefix NoTypecheck -experimental-lazy-typecheck -experimental-skip-non-exportable-decls -experimental-skip-all-function-bodies
2322
// RUN: rm -rf %t/lazy-skip-all/*.swiftmodule
2423
// RUN: %target-swift-frontend -package-name ClientPackage -typecheck -verify %S/../Inputs/lazy_typecheck_client.swift -I %t/lazy-skip-all
25-
// FIXME: The emitted interfaces should be identical
26-
// diff -u %t/baseline/lazy_typecheck.swiftinterface %t/lazy-skip-all/lazy_typecheck.swiftinterface
24+
// RUN: diff -u %t/baseline/lazy_typecheck.swiftinterface %t/lazy-skip-all/lazy_typecheck.swiftinterface
2725

2826
// (4) Same as (2), but with -experimental-skip-non-inlinable-function-bodies added.
2927
// RUN: %target-swift-frontend -swift-version 5 %S/../Inputs/lazy_typecheck.swift -module-name lazy_typecheck -typecheck -emit-module-interface-path %t/lazy-skip-non-inlinable/lazy_typecheck.swiftinterface -enable-library-evolution -parse-as-library -package-name Package -DFLAG -debug-forbid-typecheck-prefix NoTypecheck -experimental-lazy-typecheck -experimental-skip-non-inlinable-function-bodies
3028
// RUN: rm -rf %t/lazy-skip-non-inlinable/*.swiftmodule
3129
// RUN: %target-swift-frontend -package-name ClientPackage -typecheck -verify %S/../Inputs/lazy_typecheck_client.swift -I %t/lazy-skip-non-inlinable
32-
// FIXME: The emitted interfaces should be identical
33-
// diff -u %t/baseline/lazy_typecheck.swiftinterface %t/lazy-skip-non-inlinable/lazy_typecheck.swiftinterface
34-
30+
// RUN: diff -u %t/baseline/lazy_typecheck.swiftinterface %t/lazy-skip-non-inlinable/lazy_typecheck.swiftinterface

0 commit comments

Comments
 (0)