Skip to content

Commit 850797d

Browse files
committed
[SILGen] correct missing canonicalization of global actor
resolves rdar://96309577 / swiftlang#59705
1 parent 04f1cde commit 850797d

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)