@@ -423,24 +423,22 @@ template<typename T> class SILGenWitnessTable : public SILWitnessVisitor<T> {
423
423
424
424
// If it's not an accessor, just look for the witness.
425
425
if (!reqAccessor) {
426
- if (!storage) {
427
- if (auto witness = asDerived ().getWitness (reqDecl)) {
428
- auto newDecl = requirementRef.withDecl (witness.getDecl ());
429
- // Only import C++ methods as foreign. If the following
430
- // Objective-C function is imported as foreign:
431
- // () -> String
432
- // It will be imported as the following type:
433
- // () -> NSString
434
- // But the first is correct, so make sure we don't mark this witness
435
- // as foreign.
436
- if (dyn_cast_or_null<clang::CXXMethodDecl>(
437
- witness.getDecl ()->getClangDecl ()))
438
- newDecl = newDecl.asForeign ();
439
- return addMethodImplementation (
440
- requirementRef, getWitnessRef (newDecl, witness), witness);
441
- }
442
- return asDerived ().addMissingMethod (requirementRef);
443
- } // else, fallthrough to the usual accessor handling!
426
+ if (auto witness = asDerived ().getWitness (reqDecl)) {
427
+ auto newDecl = requirementRef.withDecl (witness.getDecl ());
428
+ // Only import C++ methods as foreign. If the following
429
+ // Objective-C function is imported as foreign:
430
+ // () -> String
431
+ // It will be imported as the following type:
432
+ // () -> NSString
433
+ // But the first is correct, so make sure we don't mark this witness
434
+ // as foreign.
435
+ if (dyn_cast_or_null<clang::CXXMethodDecl>(
436
+ witness.getDecl ()->getClangDecl ()))
437
+ newDecl = newDecl.asForeign ();
438
+ return addMethodImplementation (
439
+ requirementRef, getWitnessRef (newDecl, witness), witness);
440
+ }
441
+ return asDerived ().addMissingMethod (requirementRef);
444
442
} else {
445
443
// Otherwise, we need to map the storage declaration and then get
446
444
// the appropriate accessor for it.
0 commit comments