Files
swift-mirror/validation-test/Sema/SwiftUI/rdar108534555.swift
Pavel Yaskevich 0b7aeed4b8 [CSDiagnostics] Teach diagnoseConflictingGenericArguments about holes
Only fully resolved substitutions are eligible to be considered
as conflicting, if holes are involved in any position that automatically
disqualifies a generic parameter.

Resolves: rdar://108534555
Resolves: https://github.com/apple/swift/issues/63450
2023-04-27 14:58:26 -07:00

28 lines
559 B
Swift

// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.15 -swift-version 5 -disable-availability-checking
// REQUIRES: objc_interop
// REQUIRES: OS=macosx
import SwiftUI
struct Item: Identifiable {
var id: Int
var title: String
}
struct MyGroup<Content> {
init(@ViewBuilder _: () -> Content) {}
}
struct Test {
let s: [Item]
func test() {
MyGroup {
ForEach(s) {
Button($0.title) // expected-error {{value of type 'String' to expected argument type 'PrimitiveButtonStyleConfiguration'}}
}
}
}
}