Skip to content

Commit 624fece

Browse files
committed
NFC: expose an InverseRequirement::print
(cherry picked from commit 55edc30)
1 parent ef6f301 commit 624fece

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

include/swift/AST/Requirement.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ struct InverseRequirement {
270270
static void expandDefaults(ASTContext &ctx,
271271
ArrayRef<Type> gps,
272272
SmallVectorImpl<StructuralRequirement> &result);
273+
274+
void print(raw_ostream &os, const PrintOptions &opts, bool forInherited=false) const;
273275
};
274276

275277
} // end namespace swift

lib/AST/ASTPrinter.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7467,6 +7467,13 @@ void Requirement::print(ASTPrinter &printer, const PrintOptions &opts) const {
74677467
PrintAST(printer, opts).printRequirement(*this);
74687468
}
74697469

7470+
void InverseRequirement::print(raw_ostream &os,
7471+
const PrintOptions &opts,
7472+
bool forInherited) const {
7473+
StreamPrinter printer(os);
7474+
PrintAST(printer, opts).printRequirement(*this, forInherited);
7475+
}
7476+
74707477
std::string GenericSignatureImpl::getAsString() const {
74717478
return GenericSignature(const_cast<GenericSignatureImpl *>(this))
74727479
.getAsString();

0 commit comments

Comments
 (0)