Skip to content

Commit 99b86ac

Browse files
committed
Add test for relaxed circularity check from parse-time lookup removal
This didn't work in 5.3: error: variable used within its own initial value let color = color(with: 123) ^
1 parent da37637 commit 99b86ac

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/NameLookup/name_lookup.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,3 +653,12 @@ func sr9015() {
653653
let closure1 = { closure2() } // expected-error {{circular reference}} expected-note {{through reference here}} expected-note {{through reference here}}
654654
let closure2 = { closure1() } // expected-note {{through reference here}} expected-note {{through reference here}} expected-note {{through reference here}}
655655
}
656+
657+
func color(with value: Int) -> Int {
658+
return value
659+
}
660+
661+
func useColor() {
662+
let color = color(with: 123)
663+
_ = color
664+
}

0 commit comments

Comments
 (0)