static std::string getMaterializeForSetCallbackName(ProtocolConformance *conformance, FuncDecl *requirement) { DeclContext *dc = requirement; ClosureExpr closure(/*patterns*/ nullptr, /*throws*/ SourceLoc(), /*arrow*/ SourceLoc(), /*in*/ SourceLoc(), /*result*/ TypeLoc(), /*discriminator*/ 0, /*context*/ requirement); closure.setType(TupleType::getEmpty(dc->getASTContext())); closure.getCaptureInfo().setGenericParamCaptures(true); Mangle::ASTMangler Mangler; std::string New; if (conformance) { // Concrete witness thunk for a conformance: // // Mangle this as if it were a conformance thunk for a closure // within the requirement. return Mangler.mangleClosureWitnessThunk(conformance, &closure); } // Default witness thunk or concrete implementation: // // Mangle this as if it were a closure within the requirement. return Mangler.mangleClosureEntity(&closure, Mangle::ASTMangler::SymbolKind::Default); }