Metadata for archetype not bound in function.
The metadata could be missing entirely because it needs to be passed to the function.
Or the metadata is present and not bound in which case setScopedLocalTypeMetadata or similar must be called.
Archetype without metadata: τ_0_0
(primary_archetype_type address=0x11eb0e388 conforms_to="Synchronization.(file).AtomicRepresentable" name="\xCF\x84_0_0"
(interface_type=generic_type_param_type depth=0 index=0))
Function:
define private swiftcc void @objectdestroy(ptr swiftself %0) #0 !dbg !6 {
%2 = alloca i1, align 1
%3 = getelementptr inbounds <{ %swift.refcounted, %T15Synchronization6AtomicV.0 }>, ptr %0, i32 0, i32 1, !dbg !10
}
No LocalTypeDataCache for this function!
Assertion failed: (archetype->getParent() && "Not a nested archetype"), function emitArchetypeTypeMetadataRef, file GenArchetype.cpp, line 99.
Description
Crash in SILGEN on closing over consuming atomic parameter when AtomicRepresentable is generic.
Reproduction
/Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-02-a.xctoolchain/usr/bin/swift
main.swift
swift main.swift
Stack dump
Expected behavior
Working code
Environment
Additional information
Output prior to stack trace, after invocation