Skip to content

Commit 0d100e6

Browse files
authored
Merge pull request #42074 from ktoso/wip-avoid-double-typechecking
[Distributed] avoid double typechecking dist func decl
2 parents 1b4b5f5 + 7332e4b commit 0d100e6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/Sema/CodeSynthesisDistributedActor.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,7 @@ FuncDecl *GetDistributedThunkRequest::evaluate(
699699
// Force type-checking the original function, so we can avoid synthesizing
700700
// the thunks (which would have many of the same errors, if they are caused
701701
// by a bad source function signature, e.g. missing conformances etc).
702-
(void) TypeChecker::typeCheckDecl(distributedTarget);
703-
if (distributedTarget->getDiags().hadAnyError()) {
702+
if (distributedTarget->getInterfaceType()->hasError()) {
704703
return nullptr;
705704
}
706705

test/Distributed/distributed_actor_isolation.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/Inputs/FakeDistributedActorSystems.swift
3-
// RUN: %target-swift-frontend -typecheck -verify -disable-availability-checking -I %t 2>&1 %s
3+
// RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unknown -disable-availability-checking -I %t 2>&1 %s
44
// REQUIRES: concurrency
55
// REQUIRES: distributed
66

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

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

0 commit comments

Comments
 (0)