Skip to content

Commit e4923b8

Browse files
committed
Fix MainActor concurrency errors in HotReloadable macro output
1 parent 8961216 commit e4923b8

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Examples/Sources/CounterExample/CounterApp.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ struct CounterApp: App {
1818
count -= 1
1919
}
2020
Text("Count: \(count)")
21+
.foregroundColor(.red)
2122
Button("+") {
2223
count += 1
2324
}

Sources/HotReloadingMacrosPlugin/HotReloadableAppMacro.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extension HotReloadableAppMacro: PeerMacro {
2020
var hotReloadingImportedEntryPoint: (@convention(c) (UnsafeRawPointer, Int) -> Any)? = nil
2121
""",
2222
"""
23+
@MainActor
2324
@_cdecl("body")
2425
public func hotReloadingExportedEntryPoint(app: UnsafeRawPointer, viewId: Int) -> Any {
2526
hotReloadingHasConnectedToServer = true

0 commit comments

Comments
 (0)