Skip to content
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

[SR-7919] Segmentation fault with generic subscript without explicit type #50454

Closed
iby opened this issue Jun 7, 2018 · 4 comments
Closed

[SR-7919] Segmentation fault with generic subscript without explicit type #50454

iby opened this issue Jun 7, 2018 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis

Comments

@iby
Copy link

iby commented Jun 7, 2018

Previous ID SR-7919
Radar rdar://problem/40971051
Original Reporter @iby
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee @iby
Priority Medium

md5: 0656285e1d74f333f8c9f827b73124de

Issue Description:

@belkadan
Copy link
Contributor

belkadan commented Jun 8, 2018

Does not crash in Swift 4.2, but the error message is nonsense:

<stdin>:23:2: error: cannot subscript a value of type 'MyClass' with an index of type 'Foo<_>'
c[Foo()]
~^~~~~~~
<stdin>:11:5: note: found this candidate
    subscript<T>(_ foo: Foo<T>) -> T? {
    ^

@belkadan
Copy link
Contributor

belkadan commented Jun 8, 2018

cc @xedin

@xedin
Copy link
Member

xedin commented Jun 9, 2018

@swift-ci create

@xedin
Copy link
Member

xedin commented Feb 5, 2020

Looks like this has been fixed in 5.2. Please use one of the nightly snapshots to verify:

error: generic parameter 'T' could not be inferred
c[Foo()]
  ^
note: 'T' declared as parameter to type 'Foo'
struct Foo<T>
           ^
note: explicitly specify the generic arguments to fix this issue
c[Foo()]
  ^
     <Any>

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants