Skip to content

Add test for relaxed circularity check from parse-time lookup removal #36373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Mar 9, 2021

This didn't work in 5.3:

error: variable used within its own initial value
let color = color(with: 123)
            ^

The old parse-time circularity check would kick in if nothing else in an outer local scope had the same name as the binding currently being initialized. However, type and global members were not in scope to parse-time name lookup, so the error would kick in even if the code would otherwise have a valid interpretation. Of course with #34137, this is all gone and we diagnose all cycles later, where we have more semantic information.

This didn't work in 5.3:

  error: variable used within its own initial value
  let color = color(with: 123)
              ^
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit 0fb2739 into swiftlang:main Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant