This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sil_stage canonical | |
import Builtin | |
import Swift | |
import SwiftShims | |
import Foundation | |
@_hasStorage @_hasInitialValue @MainActor let myClass: MyClass { get } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TOOLCHAINS=org.swift.600202404301a swiftc -emit-sil main.swift | |
sil_stage canonical | |
import Builtin | |
import Swift | |
import SwiftShims | |
import Foundation | |
@MainActor func doSomething(a: Int) async |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct CounterView: View { | |
@State var counter = 0 | |
var body: some View { | |
Button { | |
counter += 1 | |
} label: { | |
Text(counter.description) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
public extension View { | |
func extend<Content: View>(@ViewBuilder transform: (Self) -> Content) -> some View { | |
transform(self) | |
} | |
func `if`<T: View, F: View>(_ condition: Bool, @ViewBuilder _ then: (Self) -> T, @ViewBuilder `else`: (Self) -> F) -> some View { | |
condition ? ViewBuilder.buildEither(first: then(self)) : ViewBuilder.buildEither(second: `else`(self)) | |
} |