Open
Description
Previous ID | SR-12750 |
Radar | rdar://problem/83465935 |
Original Reporter | martinboehme (JIRA User) |
Type | Bug |
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, CxxInterop |
Assignee | None |
Priority | Medium |
md5: 3311c4baf107e33900dc7b73b1b24d14
Issue Description:
When declaring a protocol conformance for an imported C++ class, SILGen aborts with an assertion failure in getParameterTypes().
To reproduce, import a C++ module containing the following:
struct ConformsToProtocol {
int return42() { return 42; }
};
And declare the following protocol conformance:
protocol HasReturn42 {
mutating func return42() -> CInt
}
extension ConformsToProtocol : HasReturn42 {}
#31617 contains a test that demonstrates this.
The failing assertion is
assert(!param.isInOut() && !param.isVariadic());
in getParameterTypes().
I'm not exactly sure what this assertion is checking. It seems to have been introduced here, when getParameterTypes() was still called expandTupleTypes():
expandTupleTypes() was renamed to getParameterTypes() here (and changed so that it no longer expands tuples):
Is this assertion still required?