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-14545] Assertion failure "Generic parameter index mismatch" when returning nil for optional generic return type #56897

ahoppen opened this issue Apr 28, 2021 · 2 comments


Copy link

@ahoppen ahoppen commented Apr 28, 2021

Previous ID SR-14545
Radar rdar://problem/77259607
Original Reporter @ahoppen
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, FoundByStressTester
Assignee @hamishknight
Priority Medium

md5: 235cbf9debc811ffaaf45fd8deb5c80d

Issue Description:

The following new test case causes an assertion failure:

protocol MyView {}

extension MyView {
  func foo<Content>() -> Content? {
// RUN: %sourcekitd-test -req=conformingmethods -pos=%(line + 1):15 %s -- %s
    return nil
Assertion failed: (param->getIndex() == count && "Generic parameter index mismatch"), function GenericSignatureImpl, file /Users/alex/swift-src/swift/lib/AST/GenericSignature.cpp, line 67.
PLEASE submit a bug report to and include the crash backtrace.
Stack dump:
0.  While performing new completion
1.  While evaluating request CodeCompletionSecondPassRequest(source_file "/Users/alex/swift-src/swift/test/SourceKit/ConformingMethods/test.swift", )
2.  While evaluating request AbstractGenericSignatureRequest(NULL, {Content, U}, {})
/Users/alex/swift-src/nbuild/Release+Asserts/tools/swift/test-macosx-x86_64/SourceKit/ConformingMethods/Output/test.swift.script: line 1: 30719 Abort trap: 6           /Users/alex/swift-src/nbuild/Release+Asserts/bin/sourcekitd-test -module-cache-path '/Users/alex/swift-src/nbuild/Release+Asserts/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache' -req=conformingmethods -pos=6:15 /Users/alex/swift-src/swift/test/SourceKit/ConformingMethods/test.swift -- /Users/alex/swift-src/swift/test/SourceKit/ConformingMethods/test.swift
Copy link
Collaborator Author

@ahoppen ahoppen commented Apr 28, 2021

@swift-ci create

Copy link
Collaborator Author

@ahoppen ahoppen commented Jul 22, 2021

Fixed in #38503

@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
None yet

No branches or pull requests

1 participant