Skip to content

Conversation

slavapestov
Copy link
Contributor

  • Description: Fix a crash on invalid that seems to be pretty common when people expect an array of hashables to be hashable but it's not.

  • Risk: Very low, this is a logic change to diagnostics, instructing it to keep going in a case where no diagnostic was emitted.

  • Tested: New test added.

  • Radar: rdar://problem/34522739

  • Reviewed by: @DougGregor

CSDiag was misinterpreting the result of checkGenericArguments().

A result of SubstitutionFailure does not mean a diagnostic was
emitted, only a result of Failure means that. This fixes a case
where we did not emit a diagnostic, result in a crash on invalid.

The diagnostic is still poor, but that's better than crashing.

Fixes <https://bugs.swift.org/browse/SR-5932>,
<rdar://problem/34522739>.
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@DougGregor Can you review this for 4.0?

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slavapestov slavapestov changed the title Sema: Fix a failure to emit a diagnostic Sema: Fix a failure to emit a diagnostic [4.0] Sep 27, 2017
@tkremenek tkremenek merged commit a779fa1 into swiftlang:swift-4.0-branch Sep 28, 2017
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.

3 participants