Skip to content

Sema: Explicitly infer requirements from subscript element type for materializeForSet [4.0] #10910

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

slavapestov
Copy link
Contributor

  • Description: Fixes a SILGen assertion failure when compiling a generic subscript where some of the requirements on the generic signature are inferred from the element type. We were not computing the generic signature of the materializeForSet accessor properly in this case.

  • Scope of the issue: If the requirement is explicitly stated, it works, but then we emit a warning telling the user to remove it. Reported externally

  • Origination: Generic subscripts are a new feature in 4.0

  • Tested: New test added

  • Reviewed by: @DougGregor

  • Radar: rdar://problem/33219034

…aterializeForSet

The interface type for materializeForSet does not mention the
element type of a subscript, so Sema was not inferring
requirements that were implied by the element type but not
explicitly stated in the generic signature.

This led to assertion failures in SILGen because the
materializeForSet calls the getter and setter, which does
have these requirements.

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

@swift-ci Please test

@slavapestov slavapestov requested a review from DougGregor July 12, 2017 21:30
@slavapestov
Copy link
Contributor Author

(Ted approved this but forgot to merge)

@slavapestov slavapestov merged commit 26a00d4 into swiftlang:swift-4.0-branch Jul 14, 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.

1 participant