Files
swift-mirror/test/DebugInfo/marker_protocol.swift
T
Augusto Noronha eb420df888 [lldb] Encode marker annotation for protocols in debug info.
Marker protocols are a compile time concept only, and emit no metadata.
RemoteInspection does not know how to handle existentials with these
types.

This patch emits debug info for marker protocols, so LLDB can handle
them properly before querying RemoteInspection for type information.

rdar://172847891
2026-03-25 14:18:32 -07:00

17 lines
496 B
Swift

// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
@_marker protocol MyMarker {}
struct ConformingType: MyMarker {
}
func f() {
let x: any MyMarker = ConformingType()
}
// Marker protocol should have the swift_marker annotation.
// CHECK-DAG: ![[MARKER:[0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "MyMarker"{{.*}}annotations: ![[ANNOT:[0-9]+]]
// CHECK-DAG: ![[ANNOT]] = !{![[ENTRY:[0-9]+]]}
// CHECK-DAG: ![[ENTRY]] = !{!"swift.MarkerProtocol", i1 true}