Skip to content

Conversation

shajrawi
Copy link

@shajrawi shajrawi commented Mar 8, 2018

radar rdar://problem/38085760

SILGen is generating code with “shadow” requirements:
convention(witness_method: ApplyRegStruct) <τ_0_0 where τ_0_0 == Type> (@inout Array) -> () {
// no use of τ_0_0 inside

In this case we have an empty substitution map but a polymorphic function type

We should relax the assert when creating apply instructions to support this case.

@shajrawi
Copy link
Author

shajrawi commented Mar 8, 2018

@swift-ci Please smoke test and merge

@@ -2438,7 +2438,6 @@ CanSILFunctionType
SILFunctionType::substGenericArgs(SILModule &silModule,
SubstitutionList subs) {
if (subs.empty()) {
assert(!isPolymorphic() && "no args for polymorphic substitution");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the right assertion is (!isPolymorphic() || getGenericSignature()->areAllParamsConcrete())

Copy link
Author

Choose a reason for hiding this comment

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

Done

…ve a polymorphic type and no substitutions required

SILGen is generating code with “shadow” requirements:
convention(witness_method: ApplyRegStruct) <τ_0_0 where τ_0_0 == Type> (@inout Array<Type>) -> () {
// no use of τ_0_0 inside

In this case we have an empty substitution map but a polymorphic function type

We should relax the assert when creating apply instructions to support this case.
@shajrawi
Copy link
Author

shajrawi commented Mar 8, 2018

@swift-ci Please smoke test and merge

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