Skip to content

[Distributed] avoid double typechecking dist func decl #42074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/Sema/CodeSynthesisDistributedActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,7 @@ FuncDecl *GetDistributedThunkRequest::evaluate(
// Force type-checking the original function, so we can avoid synthesizing
// the thunks (which would have many of the same errors, if they are caused
// by a bad source function signature, e.g. missing conformances etc).
(void) TypeChecker::typeCheckDecl(distributedTarget);
if (distributedTarget->getDiags().hadAnyError()) {
if (distributedTarget->getInterfaceType()->hasError()) {
return nullptr;
}

Expand Down
3 changes: 1 addition & 2 deletions test/Distributed/distributed_actor_isolation.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/Inputs/FakeDistributedActorSystems.swift
// RUN: %target-swift-frontend -typecheck -verify -disable-availability-checking -I %t 2>&1 %s
// RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unknown -disable-availability-checking -I %t 2>&1 %s
// REQUIRES: concurrency
// REQUIRES: distributed

Expand Down Expand Up @@ -46,7 +46,6 @@ distributed actor DistributedActor_1 {
distributed class func distributedClass() {}
// expected-error@-1{{class methods are only allowed within classes; use 'static' to declare a static method}}
// expected-error@-2{{'distributed' method cannot be 'static'}}
// expected-error@-3{{class methods are only allowed within classes; use 'static' to declare a static method}}

func hello() {} // expected-note{{distributed actor-isolated instance method 'hello()' declared here}}
func helloAsync() async {} // expected-note{{distributed actor-isolated instance method 'helloAsync()' declared here}}
Expand Down