mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: ModuleDecl::lookupConformance() is a static method
This commit is contained in:
@@ -110,10 +110,9 @@ deriveBodyMathOperator(AbstractFunctionDecl *funcDecl, MathOperator op) {
|
||||
|
||||
// Create expression combining lhs and rhs members using member operator.
|
||||
auto createMemberOpExpr = [&](VarDecl *member) -> Expr * {
|
||||
auto module = nominal->getModuleContext();
|
||||
auto memberType =
|
||||
parentDC->mapTypeIntoContext(member->getValueInterfaceType());
|
||||
auto confRef = module->lookupConformance(memberType, proto);
|
||||
auto confRef = ModuleDecl::lookupConformance(memberType, proto);
|
||||
assert(confRef && "Member does not conform to math protocol");
|
||||
|
||||
// Get member type's math operator, e.g. `Member.+`.
|
||||
@@ -249,8 +248,7 @@ deriveBodyPropertyGetter(AbstractFunctionDecl *funcDecl, ProtocolDecl *proto,
|
||||
new (C) MemberRefExpr(selfDRE, SourceLoc(), member, DeclNameLoc(),
|
||||
/*Implicit*/ true);
|
||||
}
|
||||
auto *module = nominal->getModuleContext();
|
||||
auto confRef = module->lookupConformance(memberType, proto);
|
||||
auto confRef = ModuleDecl::lookupConformance(memberType, proto);
|
||||
assert(confRef && "Member does not conform to `AdditiveArithmetic`");
|
||||
// If conformance reference is not concrete, then concrete witness
|
||||
// declaration for property cannot be resolved. Return reference to
|
||||
|
||||
Reference in New Issue
Block a user