Skip to content

Commit 6fbbcc5

Browse files
author
Harlan Haskins
authored
---
yaml --- r: 349212 b: refs/heads/master-next c: 71f3285 h: refs/heads/master
1 parent 5a7ec5d commit 6fbbcc5

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: b904133c42266035d688dec215138c340efb3eed
3+
refs/heads/master-next: 71f3285d3b9f8ed230b1eb6c7e426e85aee33b8e
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/lib/Sema/TypeCheckConstraints.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -894,12 +894,6 @@ namespace {
894894
continue;
895895
}
896896

897-
// Coercions can be used for disambiguation.
898-
if (auto coerce = dyn_cast<CoerceExpr>(callee)) {
899-
callee = coerce->getSubExpr();
900-
continue;
901-
}
902-
903897
// We're done.
904898
break;
905899
}

branches/master-next/test/Sema/suppress-argument-labels-in-types.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,21 @@ class C0 {
204204

205205
// Check diagnostics changes.
206206
let _ = min(Int(3), Float(2.5)) // expected-error{{cannot convert value of type 'Float' to expected argument type 'Int'}}
207+
208+
// SR-11429
209+
func testIntermediateCoercions() {
210+
_ = (f1 as (Int, Int) -> Int)(a: 0, b: 1) // expected-error {{extraneous argument labels 'a:b:' in call}}
211+
_ = (f1 as (Int, Int) -> Int)(0, 1)
212+
213+
typealias Magic<T> = T
214+
_ = (f1 as Magic)(a: 0, b: 1) // expected-error {{extraneous argument labels 'a:b:' in call}}
215+
_ = (f1 as Magic)(0, 1)
216+
217+
_ = (f4 as (Int, Int) -> Int)(0, 0)
218+
_ = (f4 as (Double, Double) -> Double)(0, 0)
219+
220+
func iuoReturning() -> Int! {}
221+
_ = (iuoReturning as () -> Int?)()
222+
_ = (iuoReturning as Magic)()
223+
_ = (iuoReturning as () -> Int)() // expected-error {{cannot convert value of type '() -> Int?' to type '() -> Int' in coercion}}
224+
}

0 commit comments

Comments
 (0)