Skip to content

Commit f512c4b

Browse files
committed
[SILGen] correct missing canonicalization of global actor
resolves rdar://96309577 / #59705
1 parent 4c347d2 commit f512c4b

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
@@ -733,7 +733,7 @@ void SILGenFunction::emitPrologGlobalActorHop(SILLocation loc,
733733
}
734734

735735
SILValue SILGenFunction::emitLoadGlobalActorExecutor(Type globalActor) {
736-
CanType actorType = CanType(globalActor);
736+
CanType actorType = globalActor->getCanonicalType();
737737
NominalTypeDecl *nominal = actorType->getNominalOrBoundGenericNominal();
738738
VarDecl *sharedInstanceDecl = nominal->getGlobalActorInstance();
739739
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)