Skip to content

Commit b25dc44

Browse files
committed
[Runtime] Cast to the correct type.
Effectively NFC, because the compiler is not likely to ever notice the aliasing violation here.
1 parent c1782d8 commit b25dc44

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/swift/Runtime/Metadata.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ template <typename Runtime> struct TargetGenericMetadata;
727727
template <typename Runtime> struct TargetClassMetadata;
728728
template <typename Runtime> struct TargetStructMetadata;
729729
template <typename Runtime> struct TargetOpaqueMetadata;
730+
template <typename Runtime> struct TargetValueMetadata;
730731

731732
// FIXME: https://bugs.swift.org/browse/SR-1155
732733
#pragma clang diagnostic push
@@ -902,7 +903,7 @@ struct TargetMetadata {
902903
case MetadataKind::Struct:
903904
case MetadataKind::Enum:
904905
case MetadataKind::Optional:
905-
return static_cast<const TargetStructMetadata<Runtime> *>(this)
906+
return static_cast<const TargetValueMetadata<Runtime> *>(this)
906907
->Description;
907908
case MetadataKind::ForeignClass:
908909
case MetadataKind::Opaque:

0 commit comments

Comments
 (0)