Is Function Builder Just Too Fragile to Compile Certain SwiftUI @ViewBuilder Code?

I'm facing some compile errors on perfectly legal syntax. Inside among my views' other views, this thing compile fine as

Text("abcd")

If I change it to:

Text(verbatim: "abcd")
// or
Text(String("abcd"))

compile error pop up somewhere else. I just want to make a verbatim Text view...why these not compile, but Text("abcd") compile fine?

similarly, this is okay:

Text("abcd")
    .accessibility(label: Text("Hello"))

but not this:

Text("abcd")
    .accessibility(label: Text("Hello"))
    .accessibility(value: Text("Hello"))

compile error shows up somewhere else.

I've verified all these code are legit, can compile by themself...

I cannot come up with ways to trick the compiler into accepting my code... :frowning:

Are these simple beta issue and I just have to wait for fix?

Terms of Service

Privacy Policy

Cookie Policy