Suddenly getting "Trailing closure passed to parameter of type 'Visibility' that does not accept a closure" for toolbars

Not sure exactly what’s going on here. I’ve been building out this little app for the past couple of weeks using Xcode 16 betas, and in a couple of places I have code like this:

				EditItemView(item: inItem)
					.toolbar
					{
						ToolbarItem
						{
							Button(action: { self.printLabel(item: inItem) })
							{
								Label("Print Label", systemImage: "printer.filled.and.paper")
							}
						}
					}

Now all of a sudden I'm getting an error on .toolbar: “Trailing closure passed to parameter of type 'Visibility' that does not accept a closure.”

Looking at the comment for toolbar, it says this method "specifies the visibility," which is a weird thing for it to do with a name like that. But it also has a deprecation tag that I don't quite understand: @available(macOS, introduced: 13.0, deprecated: 100000.0, renamed: "toolbarVisibility(_:for:)"). The name change makes sense, given the description. But what is the huge deprecation version number? Just a hack?

And why is this code no longer compiling? As I'm commenting out instances of this, all my toolbars are failing in this way.

ETA: yeah, I finally found the right declaration of .toolbar: func toolbar<Content>(@ViewBuilder content: () -> Content) -> some View where Content : View. It's no longer choosing that one. I hate Swift sometimes.

ETA2: I finally whittled it down to it not liking Label for some reason. Replacing that with Image works. But of course, the compiler won't tell me why.

ETA3: It's worse than I thought: I tried to make a small test case for a bug, and Label works just fine. Why does my code not?

Suddenly getting "Trailing closure passed to parameter of type 'Visibility' that does not accept a closure" for toolbars
 
 
Q