Skip to content

Commit 326e578

Browse files
committed
[concurrency] SILGen: allow the Builtin.createAsyncTaskFuture to have a non-generic closure argument.
It fixes a crash in SILGen if Builtin.createAsyncTaskFuture is used in a non-generic context. I found this by experiment - we don't use it currently in the stdlib. But it doesn't harm to fix this.
1 parent 863dcec commit 326e578

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILGen/SILGenBuiltin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ static ManagedValue emitBuiltinCreateAsyncTaskFuture(
14391439
// Form the metatype of the result type.
14401440
CanType futureResultType =
14411441
Type(
1442-
MetatypeType::get(GenericTypeParamType::get(0, 0, SGF.getASTContext())))
1442+
MetatypeType::get(GenericTypeParamType::get(0, 0, SGF.getASTContext()), MetatypeRepresentation::Thick))
14431443
.subst(subs)->getCanonicalType();
14441444
CanType anyTypeType = ExistentialMetatypeType::get(
14451445
ProtocolCompositionType::get(ctx, { }, false))->getCanonicalType();

0 commit comments

Comments
 (0)