@@ -1847,15 +1847,17 @@ namespace {
1847
1847
ConcurrentReferenceKind::CrossActor);
1848
1848
}
1849
1849
1850
+ // Call is implicitly asynchronous.
1851
+ auto result = tryMarkImplicitlyAsync (
1852
+ loc, valueRef, context,
1853
+ ImplicitActorHopTarget::forGlobalActor (globalActor));
1854
+ if (result == AsyncMarkingResult::FoundAsync)
1855
+ return false ;
1856
+
1857
+ // Diagnose failures.
1850
1858
switch (contextIsolation) {
1851
1859
case ActorIsolation::DistributedActorInstance:
1852
1860
case ActorIsolation::ActorInstance: {
1853
- auto result = tryMarkImplicitlyAsync (
1854
- loc, valueRef, context,
1855
- ImplicitActorHopTarget::forGlobalActor (globalActor));
1856
- if (result == AsyncMarkingResult::FoundAsync)
1857
- return false ;
1858
-
1859
1861
auto useKind = static_cast <unsigned >(
1860
1862
kindOfUsage (value, context).getValueOr (VarRefUseEnv::Read));
1861
1863
@@ -1869,14 +1871,6 @@ namespace {
1869
1871
1870
1872
case ActorIsolation::GlobalActor:
1871
1873
case ActorIsolation::GlobalActorUnsafe: {
1872
- // Check if this decl reference is the callee of the enclosing Apply,
1873
- // making it OK as an implicitly async call.
1874
- auto result = tryMarkImplicitlyAsync (
1875
- loc, valueRef, context,
1876
- ImplicitActorHopTarget::forGlobalActor (globalActor));
1877
- if (result == AsyncMarkingResult::FoundAsync)
1878
- return false ;
1879
-
1880
1874
auto useKind = static_cast <unsigned >(
1881
1875
kindOfUsage (value, context).getValueOr (VarRefUseEnv::Read));
1882
1876
@@ -1891,12 +1885,6 @@ namespace {
1891
1885
}
1892
1886
1893
1887
case ActorIsolation::Independent: {
1894
- auto result = tryMarkImplicitlyAsync (
1895
- loc, valueRef, context,
1896
- ImplicitActorHopTarget::forGlobalActor (globalActor));
1897
- if (result == AsyncMarkingResult::FoundAsync)
1898
- return false ;
1899
-
1900
1888
auto useKind = static_cast <unsigned >(
1901
1889
kindOfUsage (value, context).getValueOr (VarRefUseEnv::Read));
1902
1890
@@ -1910,12 +1898,6 @@ namespace {
1910
1898
}
1911
1899
1912
1900
case ActorIsolation::Unspecified: {
1913
- auto result = tryMarkImplicitlyAsync (
1914
- loc, valueRef, context,
1915
- ImplicitActorHopTarget::forGlobalActor (globalActor));
1916
- if (result == AsyncMarkingResult::FoundAsync)
1917
- return false ;
1918
-
1919
1901
// Diagnose the reference.
1920
1902
auto useKind = static_cast <unsigned >(
1921
1903
kindOfUsage (value, context).getValueOr (VarRefUseEnv::Read));
0 commit comments