Files
swift-mirror/validation-test/Sema/rdar84879566.swift
Pavel Yaskevich 609841710f [ConstraintLocator] Allow simplification of constructor member with overloaded base
`init` calls to redeclared types would end up diagnosed as ambiguity,
so locator simplification needs to account for the fact that "base"
of constructor might be overloaded type reference.

Resolves: rdar://84879566
2021-11-05 16:44:07 -07:00

26 lines
555 B
Swift

// RUN: %target-swift-frontend -typecheck -target x86_64-apple-macosx10.15 -swift-version 5 %S/Inputs/rdar84879566_invalid_decls.swift -primary-file %s -verify
// REQUIRES: OS=macosx
protocol Tupled {
associatedtype TupleType
@TupleBuilder var tuple: TupleType { get }
}
@resultBuilder
struct TupleBuilder {
static func buildBlock() -> () {
return ()
}
static func buildBlock<T1>(_ t1: T1) -> (T1) {
return (t1)
}
}
struct MyApp: Tupled {
var tuple: some Any {
MyView() // expected-error {{ambiguous use of 'init()'}}
}
}