Skip to content

Sema: Fix failure to emit diagnostic with some invalid member type references #33692

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

Conversation

slavapestov
Copy link
Contributor

There were two problems here:

  • isUnsupportedMemberTypeReference() checked if the immediate parent type was
    an unbound generic type, but did not check for the parent of the parent, etc.

  • The caller of isUnsupportedMemberTypeReference() had to re-check the
    various invalid conditions to determine what diagnostic to emit, and if
    none of those conditions matched it would just return an ErrorType without
    emitting a diagnostic.

Fix both of these by having isUnsupportedMemberTypeReference() return an
enum indicating what went wrong, and handle more cases.

Fixes rdar://problem/67292528.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov force-pushed the another-invalid-nested-type-fix branch from 1952218 to 1e14e51 Compare August 29, 2020 02:51
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@CodaFi
Copy link
Contributor

CodaFi commented Aug 29, 2020

@swift-ci smoke test

…ferences

There were two problems here:

- isUnsupportedMemberTypeReference() checked if the immediate parent type was
  an unbound generic type, but did not check for the parent of the parent, etc.

- The caller of isUnsupportedMemberTypeReference() had to re-check the
  various invalid conditions to determine what diagnostic to emit, and if
  none of those conditions matched it would just return an ErrorType without
  emitting a diagnostic.

Fix both of these by having isUnsupportedMemberTypeReference() return an
enum indicating what went wrong, and handle more cases.

Fixes <rdar://problem/67292528>.
@slavapestov slavapestov force-pushed the another-invalid-nested-type-fix branch from 1e14e51 to dcc27ea Compare August 30, 2020 04:13
@slavapestov
Copy link
Contributor Author

@CodaFi It was totally my fault, I forgot to update a couple of testcases where diagnostics changed.

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov slavapestov merged commit 72d813d into swiftlang:master Sep 1, 2020
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.

2 participants