Skip to content

Commit a52fe65

Browse files
committed
Move a cycle
1 parent 464aab6 commit a52fe65

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void swift::setBoundVarsTypeError(Pattern *pattern, ASTContext &ctx) {
3939
pattern->forEachVariable([&](VarDecl *var) {
4040
// Don't change the type of a variable that we've been able to
4141
// compute a type for.
42-
if (var->hasInterfaceType() && !var->getType()->hasError())
42+
if (var->hasInterfaceType())
4343
return;
4444

4545
var->setInterfaceType(ErrorType::get(var->getASTContext()));
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-typecheck-verify-swift
22

3-
typealias A = B // expected-error {{type alias 'A' references itself}}
4-
typealias C = D // expected-note {{through reference here}}
5-
typealias D = (A, Int) // expected-note {{through reference here}}
6-
typealias B = C // expected-note {{through reference here}}
3+
typealias A = B // expected-error {{type alias 'A' references itself}} expected-note {{through reference here}}
4+
typealias C = D // expected-note {{through reference here}} expected-note {{through reference here}}
5+
typealias D = (A, Int) // expected-note {{through reference here}} expected-note {{through reference here}}
6+
typealias B = C // expected-note {{through reference here}} expected-note {{through reference here}}

test/NameBinding/name_lookup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,6 @@ struct PatternBindingWithTwoVars3 { var x = y, y = x }
628628

629629
// https://bugs.swift.org/browse/SR-9015
630630
func sr9015() {
631-
let closure1 = { closure2() } // expected-error {{circular reference}} expected-error{{variable 'closure1' is not bound by any pattern}} expected-note {{through reference here}}
632-
let closure2 = { closure1() } // expected-note {{through reference here}} expected-note {{through reference here}}
631+
let closure1 = { closure2() } // expected-error {{circular reference}} expected-error{{variable 'closure1' is not bound by any pattern}} expected-note {{through reference here}} expected-note {{through reference here}}
632+
let closure2 = { closure1() } // expected-note {{through reference here}} expected-note {{through reference here}} expected-note {{through reference here}}
633633
}

test/Sema/diag_typealias.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
struct S {}
44

5-
typealias S = S // expected-error {{type alias 'S' references itself}}
5+
typealias S = S // expected-error {{type alias 'S' references itself}} expected-note {{through reference here}}

test/decl/init/basic_init.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class C {
1010
init() {}
1111
}
1212

13-
typealias t = t // expected-error {{type alias 't' references itself}}
13+
typealias t = t // expected-error {{type alias 't' references itself}} expected-note {{through reference here}}
1414

1515
extension Foo {
1616
convenience init() {} // expected-error{{invalid redeclaration of synthesized 'init()'}}

test/decl/var/variables.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ let a = b ; let b = a
7171
// expected-note@-3 {{through reference here}}
7272
// expected-note@-4 {{through reference here}}
7373
// expected-note@-5 {{through reference here}}
74+
// expected-note@-6 {{through reference here}}
75+
// expected-note@-7 {{through reference here}}
7476

7577
// <rdar://problem/17501765> Swift should warn about immutable default initialized values
7678
let uselessValue : String?

0 commit comments

Comments
 (0)