Cannot convert value of type 'TupleView<(Image, some View)>' to closure result type '_'

I've just updated to the latest Xcode 11 GM and it has broken my code. I have this HStack as follows:


HStack {
            Image(systemName: "rectangle.on.rectangle.angled")
            
            Text(verbatim: "Study")
              .listRowPlatterColor(Color.gray)
              .frame(height:50)

          }


But in the latest version I am getting this error:

Cannot convert value of type 'TupleView<(Image, some View)>' to closure result type '_'


What do I need to do to make HStack comply with the latest syntax?

Replies

Which line do you get the error ? Line 2 ?


Have you checked XCode has installed all components ? Could try to rstart Mac to be sure.

I plugged that code into a new watchOS app (creating from the watchOS > iOS App with Watch App template) and it compiled just fine. Here’s what the final

ContentView.swift
looks like:
import SwiftUI

struct ContentView: View {
    var body: some View {
        HStack {
            Image(systemName: "rectangle.on.rectangle.angled")
            Text(verbatim: "Study")
                .listRowPlatterColor(Color.gray)
                .frame(height:50)
            }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

You may have some wreckage left over from one of the Xcode betas. To rule that out, do a clean build (Product > Clean Build Folder then rebuild).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

The error is on line 2.


I am so confused, I have deleted the old Xcode beta and re-installed Xcode 11 GM and cleaned the build folder. But I am still getting the same compiler error.

I have pinpointed the issue. Even though the error was appearing next to HStack, what caused it was this line of code I had outside of my List:

.listStyle(.carousel)


The irony is that this line of code was introduced in one of the WWDC session videos, and now it doesn't work anymore.

So the error was not on line 2.


SwiftUI evolves so much rapidly at this time, taht code sample are very rapidly outdated.

I have pinpointed the issue.

Cool. Did that allow you to fix it? If not, please post a minimal snippet that reproduces the problem.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"