Skip to content

[CursorInfo] Fix crash on instance variables used directly in if or for when declared in a generic context #14171

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

Conversation

nathawes
Copy link
Contributor

For example:

class Foo<T> {
  let test: Bool = false
  let items: [Int] = []
  func foo() {
    if test {} // crashes on test
    for i in items {} // crashes on items
  }
}

We were picking up the incorrect containing type (Bool rather than Foo<T>).
Resolves rdar://problem/36871908.

…or when declared in a generic context

For example:
class Foo<T> {
  let test: Bool = false
  let items: [Int] = []
  func foo() {
    if test {} // crashes on test
    for i in items {} // crashes on items
  }
}

We were picking up the incorrect containing type (Bool rather than Foo<T>).
Resolves rdar://problem/36871908.
@nathawes
Copy link
Contributor Author

@swift-ci please smoke test

@nathawes nathawes merged commit ef4624b into swiftlang:master Jan 26, 2018
@nathawes nathawes deleted the rdar36871908-cursor-info-crash-on-ivar-of-generic-context-used-in-if-or-for branch January 26, 2018 19:36
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