Skip to content

Commit 9234cd6

Browse files
authored
Merge pull request swiftlang#60861 from kavon/overly-sweet-mainactor-96309577
[SILGen] correct missing canonicalization of global actor
2 parents 41884fd + 850797d commit 9234cd6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/SILGen/SILGenProlog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ void SILGenFunction::emitPrologGlobalActorHop(SILLocation loc,
823823
}
824824

825825
SILValue SILGenFunction::emitLoadGlobalActorExecutor(Type globalActor) {
826-
CanType actorType = CanType(globalActor);
826+
CanType actorType = globalActor->getCanonicalType();
827827
NominalTypeDecl *nominal = actorType->getNominalOrBoundGenericNominal();
828828
VarDecl *sharedInstanceDecl = nominal->getGlobalActorInstance();
829829
assert(sharedInstanceDecl && "no shared actor field in global actor");

test/SILGen/hop_to_executor_async_prop.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ struct Blah {
667667
}
668668
}
669669

670-
@MainActor
670+
typealias FancyActor = MainActor // helps cover rdar://96309577
671+
672+
@FancyActor
671673
func getTemperature() -> Int { return 0 }
672674

673675
@MainActor

0 commit comments

Comments
 (0)