Skip to content

Commit f191730

Browse files
committed
[Distributed] workaround for inout removal fixit
1 parent 069942e commit f191730

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/Sema/TypeCheckDistributed.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ bool swift::checkDistributedFunction(FuncDecl *func, bool diagnose) {
154154
diag::distributed_actor_func_inout,
155155
param->getName(),
156156
func->getDescriptiveKind(), func->getName()
157-
).fixItRemove(param->getSpecifierLoc()); // FIXME(distributed): does not seem to cause the fixit...? Is the Loc invalid...?
157+
).fixItRemove(SourceRange(param->getTypeSourceRangeForDiagnostics().Start,
158+
param->getTypeSourceRangeForDiagnostics().Start.getAdvancedLoc(1)));
159+
// FIXME(distributed): the fixIt should be on param->getSpecifierLoc(), but that Loc is invalid for some reason?
158160
return true;
159161
}
160162

test/Distributed/distributed_actor_isolation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ distributed actor DistributedActor_1 {
8484
}
8585

8686
distributed func noInout(inNOut burger: inout String) {
87-
// expected-error@-1{{cannot declare 'inout' argument 'burger' in distributed instance method 'noInout(inNOut:)'}}
87+
// expected-error@-1{{cannot declare 'inout' argument 'burger' in distributed instance method 'noInout(inNOut:)'}}{{43-49=}}
8888
}
8989

9090
distributed func distReturnGeneric<T: Codable & Sendable>(item: T) async throws -> T { // ok

0 commit comments

Comments
 (0)