Skip to content

Commit 659bbd0

Browse files
committed
[Distributed] register distributed_thunk witness earlier, and bring back strong assertion
1 parent 114399d commit 659bbd0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5530,6 +5530,22 @@ void ConformanceChecker::resolveValueWitnesses() {
55305530
.withEnterIsolation(*enteringIsolation));
55315531
}
55325532

5533+
// FIXME: almost right...
5534+
// if (requirement->isDistributed()) {
5535+
// // When witnessing a 'distributed' requirement, we also immediately
5536+
// // register the witness for the distributed_thunk. Doing is more correct,
5537+
// // as otherwise we might end up trying to modify an already completed
5538+
// // conformance once we get to visit the thunk itself.
5539+
// if (auto func = dyn_cast<AbstractFunctionDecl>(requirement)) {
5540+
// auto thunkRequirement = func->getDistributedThunk();
5541+
// assert(thunkRequirement->isDistributedThunk());
5542+
// auto distributedWitness = dyn_cast<AbstractFunctionDecl>(witness);
5543+
// auto thunkWitness = Witness(distributedWitness->getDistributedThunk());
5544+
// assert(dyn_cast<FuncDecl>(thunkWitness.getDecl())->isDistributedThunk());
5545+
// Conformance->setWitness(thunkRequirement, thunkWitness);
5546+
// }
5547+
// }
5548+
55335549
// Objective-C checking for @objc requirements.
55345550
if (requirement->isObjC() &&
55355551
requirement->getName() == witness->getName() &&

0 commit comments

Comments
 (0)