I tried to mark result builder functions with async but compiler crashed.
/// Minimal reproduction: async result builder causes compiler crash
/// Swift 6.2.3 on Linux (Ubuntu 24.04)
///
/// To reproduce:
/// swiftc -parse-as-library main.swift
///
/// Expected: Compiler error explaining async is not supported in result builders
/// Actual: Compiler crashes with SIGSEGV (signal 11)
@resultBuilder
public struct ParaBuild
{
// async causes compiler crash (SIGSEGV).
// The compiler does not reject async as invalid syntax,
// but crashes during LLVM code generation at
// llvm::ValueEnumerator::ValueEnumerator.
public static func buildBlock(_ x: Int) /* async */ -> Int
{
return x
}
}
struct ExampleBuild
{
@ParaBuild var content: Int
{
42
}
}
@main
struct Main
{
static func main()
{
let example = ExampleBuild()
print("Content: \(example.content)")
}
}