Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/IRGen/GenProto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2748,8 +2748,16 @@ void NecessaryBindings::save(IRGenFunction &IGF, Address buffer) const {
void NecessaryBindings::addTypeMetadata(CanType type) {
assert(!isa<InOutType>(type));

// If the bindings are for an async function, we will always need the type
// metadata. The opportunities to reconstruct it available in the context of
// partial apply forwarders are not available here.
if (forAsyncFunction()) {
addRequirement({type, nullptr});
return;
}

// Bindings are only necessary at all if the type is dependent.
if (!type->hasArchetype() && !forAsyncFunction())
if (!type->hasArchetype())
return;

// Break down structural types so that we don't eagerly pass metadata
Expand Down
8 changes: 8 additions & 0 deletions validation-test/compiler_crashers_2_fixed/rdar71816041.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// RUN: %target-swift-frontend -emit-ir -primary-file %s -enable-experimental-concurrency

func getIntAndString() async -> (Int, String) { (5, "1") }

func testDecompose() async -> Int {
async let (i, s) = await getIntAndString()
return await i
}