Skip to content

Commit 604ab0d

Browse files
committed
Concurrent functions don't need to ConcurrentValue parameters/results
1 parent 1d506da commit 604ab0d

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
129129
IGNORED_ATTR(OriginallyDefinedIn)
130130
IGNORED_ATTR(NoDerivative)
131131
IGNORED_ATTR(SpecializeExtension)
132+
IGNORED_ATTR(Concurrent)
132133
#undef IGNORED_ATTR
133134

134135
void visitAlignmentAttr(AlignmentAttr *attr) {
@@ -420,22 +421,6 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
420421
}
421422
}
422423
}
423-
424-
void visitConcurrentAttr(ConcurrentAttr *attr) {
425-
auto VD = dyn_cast<ValueDecl>(D);
426-
if (!VD)
427-
return;
428-
429-
auto innermostDC = VD->getInnermostDeclContext();
430-
SubstitutionMap subs;
431-
if (auto genericEnv = innermostDC->getGenericEnvironmentOfContext()) {
432-
subs = genericEnv->getForwardingSubstitutionMap();
433-
}
434-
435-
(void)diagnoseNonConcurrentTypesInReference(
436-
ConcreteDeclRef(VD, subs), innermostDC, VD->getLoc(),
437-
ConcurrentReferenceKind::ConcurrentFunction);
438-
}
439424
};
440425
} // end anonymous namespace
441426

test/Concurrency/concurrent_value_checking.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ class SomeClass: MainActorProto {
147147
// ConcurrentValue restriction on concurrent functions.
148148
// ----------------------------------------------------------------------
149149

150-
// FIXME: poor diagnostic
151-
@concurrent func concurrentFunc() -> NotConcurrent? { nil } // expected-warning{{cannot call function returning non-concurrent-value type 'NotConcurrent?' across actors}}
150+
@concurrent func concurrentFunc() -> NotConcurrent? { nil }
152151

153152
// ----------------------------------------------------------------------
154153
// No ConcurrentValue restriction on @concurrent function types.

0 commit comments

Comments
 (0)