Skip to content

Commit 20b4ec2

Browse files
committed
---
yaml --- r: 322303 b: refs/heads/tensorflow-next c: b96eef8 h: refs/heads/master i: 322301: bc8b2fb 322299: 9ec7f53 322295: 2c1711e 322287: edabaf7 322271: 3210d5b 322239: 0368666 322175: 0661fd1 322047: 31861de
1 parent 9cd4732 commit 20b4ec2

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,4 +1461,4 @@ refs/heads/master-rebranch: 86e95c23aa0d37f24ec138b7853146c1cead2e40
14611461
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14621462
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14631463
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec
1464-
refs/heads/tensorflow-next: 81ad405661a478f9338b9ba05376a19f1228c168
1464+
refs/heads/tensorflow-next: b96eef8e8e3e6c58df1caeff0fde0873c60f3dc2

branches/tensorflow-next/lib/Sema/TypeCheckType.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3045,15 +3045,20 @@ Type TypeResolver::resolveTupleType(TupleTypeRepr *repr,
30453045
complained = true;
30463046
}
30473047

3048+
bool hadError = false;
30483049
for (unsigned i = 0, end = repr->getNumElements(); i != end; ++i) {
30493050
auto *tyR = repr->getElementType(i);
30503051

30513052
Type ty = resolveType(tyR, elementOptions);
3052-
if (!ty || ty->hasError()) return ty;
3053+
if (!ty || ty->hasError())
3054+
hadError = true;
30533055

30543056
elements.emplace_back(ty, repr->getElementName(i), ParameterTypeFlags());
30553057
}
30563058

3059+
if (hadError)
3060+
return ErrorType::get(Context);
3061+
30573062
// Single-element labeled tuples are not permitted outside of declarations
30583063
// or SIL, either.
30593064
if (elements.size() == 1 && elements[0].hasName()

branches/tensorflow-next/test/Compatibility/tuple_arguments_4.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,14 +1464,17 @@ let _ = sr4745.enumerated().map { (count, element) in "\(count): \(element)" }
14641464
// SR-4738
14651465

14661466
let sr4738 = (1, (2, 3))
1467-
[sr4738].map { (x, (y, z)) -> Int in x + y + z } // expected-error {{use of undeclared type 'y'}}
1467+
// expected-error @+2{{use of undeclared type 'y'}}
1468+
// expected-error @+1{{use of undeclared type 'z'}}
1469+
[sr4738].map { (x, (y, z)) -> Int in x + y + z }
14681470
// expected-error@-1 {{closure tuple parameter does not support destructuring}} {{20-26=arg1}} {{38-38=let (y, z) = arg1; }}
14691471

14701472
// rdar://problem/31892961
14711473
let r31892961_1 = [1: 1, 2: 2]
14721474
r31892961_1.forEach { (k, v) in print(k + v) }
14731475

14741476
let r31892961_2 = [1, 2, 3]
1477+
// expected-error @+1{{use of undeclared type 'val'}}
14751478
let _: [Int] = r31892961_2.enumerated().map { ((index, val)) in
14761479
// expected-error@-1 {{closure tuple parameter does not support destructuring}} {{48-60=arg0}} {{3-3=\n let (index, val) = arg0\n }}
14771480
// expected-error@-2 {{use of undeclared type 'index'}}
@@ -1689,4 +1692,4 @@ _ = x.map { (_: Void) in return () }
16891692
do {
16901693
func f(_: Int...) {}
16911694
let _ = [(1, 2, 3)].map(f) // expected-error {{cannot invoke 'map' with an argument list of type '((Int...) -> ())'}}
1692-
}
1695+
}

branches/tensorflow-next/test/Constraints/tuple_arguments.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,14 +1467,17 @@ let _ = sr4745.enumerated().map { (count, element) in "\(count): \(element)" }
14671467
// SR-4738
14681468

14691469
let sr4738 = (1, (2, 3))
1470-
[sr4738].map { (x, (y, z)) -> Int in x + y + z } // expected-error {{use of undeclared type 'y'}}
1470+
// expected-error@+2{{use of undeclared type 'y'}}
1471+
// expected-error@+1{{use of undeclared type 'z'}}
1472+
[sr4738].map { (x, (y, z)) -> Int in x + y + z }
14711473
// expected-error@-1 {{closure tuple parameter does not support destructuring}} {{20-26=arg1}} {{38-38=let (y, z) = arg1; }}
14721474

14731475
// rdar://problem/31892961
14741476
let r31892961_1 = [1: 1, 2: 2]
14751477
r31892961_1.forEach { (k, v) in print(k + v) }
14761478

14771479
let r31892961_2 = [1, 2, 3]
1480+
// expected-error@+1{{use of undeclared type 'val'}}
14781481
let _: [Int] = r31892961_2.enumerated().map { ((index, val)) in
14791482
// expected-error@-1 {{closure tuple parameter does not support destructuring}} {{48-60=arg0}} {{3-3=\n let (index, val) = arg0\n }}
14801483
// expected-error@-2 {{use of undeclared type 'index'}}

branches/tensorflow-next/test/attr/attr_inout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ func f(x : inout Int) { } // okay
44

55
func h(_ : inout Int) -> (inout Int) -> (inout Int) -> Int { }
66

7-
func ff(x: (inout Int, inout Float)) { } // expected-error {{'inout' may only be used on parameters}}
7+
func ff(x: (inout Int, inout Float)) { } // expected-error 2{{'inout' may only be used on parameters}}
88

99
enum inout_carrier {
1010
case carry(inout Int) // expected-error {{'inout' may only be used on parameters}}

branches/tensorflow-next/test/decl/func/functions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func parseError6(_ a: unknown_type, b: ) {} // expected-error {{use of undeclare
8888

8989
func parseError7(_ a: Int, goo b: unknown_type) {} // expected-error {{use of undeclared type 'unknown_type'}}
9090

91-
public func foo(_ a: Bool = true) -> (b: Bar, c: Bar) {} // expected-error {{use of undeclared type 'Bar'}}
91+
public func foo(_ a: Bool = true) -> (b: Bar, c: Bar) {} // expected-error 2{{use of undeclared type 'Bar'}}
9292

9393
func parenPatternInArg((a): Int) -> Int { // expected-error {{expected parameter name followed by ':'}}
9494
return a // expected-error {{use of unresolved identifier 'a'}}

0 commit comments

Comments
 (0)