Skip to content

Commit 24ee8cf

Browse files
committed
AST: Add typeCheckFunctionBodies parameter to getUniqueUnderlyingTypeSubstitutions()
1 parent fa68c27 commit 24ee8cf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

include/swift/AST/Decl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3659,7 +3659,8 @@ class OpaqueTypeDecl final :
36593659

36603660
/// The substitutions that map the generic parameters of the opaque type to
36613661
/// the unique underlying types, when that information is known.
3662-
std::optional<SubstitutionMap> getUniqueUnderlyingTypeSubstitutions() const;
3662+
std::optional<SubstitutionMap> getUniqueUnderlyingTypeSubstitutions(
3663+
bool typeCheckFunctionBodies=true) const;
36633664

36643665
void setUniqueUnderlyingTypeSubstitutions(SubstitutionMap subs) {
36653666
assert(!UniqueUnderlyingType.has_value() && "resetting underlying type?!");

lib/AST/Decl.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10840,7 +10840,11 @@ bool OpaqueTypeDecl::exportUnderlyingType() const {
1084010840
}
1084110841

1084210842
std::optional<SubstitutionMap>
10843-
OpaqueTypeDecl::getUniqueUnderlyingTypeSubstitutions() const {
10843+
OpaqueTypeDecl::getUniqueUnderlyingTypeSubstitutions(
10844+
bool typeCheckFunctionBodies) const {
10845+
if (!typeCheckFunctionBodies)
10846+
return UniqueUnderlyingType;
10847+
1084410848
return evaluateOrDefault(getASTContext().evaluator,
1084510849
UniqueUnderlyingTypeSubstitutionsRequest{this}, {});
1084610850
}

0 commit comments

Comments
 (0)