From ea5a31d18f8cc8bc1318579768de5033bd7297cd Mon Sep 17 00:00:00 2001 From: Holly Borla Date: Mon, 29 Jun 2020 15:14:46 -0700 Subject: [PATCH] [NFC] Add a test for constraint generation failures in a pattern binding decl inside of a function builder. --- test/Constraints/function_builder_diags.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/Constraints/function_builder_diags.swift b/test/Constraints/function_builder_diags.swift index 1a04e05892926..359fa6bdad05d 100644 --- a/test/Constraints/function_builder_diags.swift +++ b/test/Constraints/function_builder_diags.swift @@ -418,11 +418,14 @@ func testNonExhaustiveSwitch(e: E) { // rdar://problem/59856491 struct TestConstraintGenerationErrors { @TupleBuilder var buildTupleFnBody: String { + let a = nil // expected-error {{'nil' requires a contextual type}} String(nothing) // expected-error {{cannot find 'nothing' in scope}} } func buildTupleClosure() { - tuplify(true) { _ in + // FIXME: suppress the ambiguity error + tuplify(true) { _ in // expected-error {{type of expression is ambiguous without more context}} + let a = nothing // expected-error {{cannot find 'nothing' in scope}} String(nothing) // expected-error {{cannot find 'nothing' in scope}} } }