Skip to content

Commit 28985f4

Browse files
committed
Swift AST: add var EnumDecl.hasRawType
1 parent 8b4740f commit 28985f4

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

SwiftCompilerSources/Sources/AST/Declarations.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public class NominalTypeDecl: GenericTypeDecl {
5858
}
5959
}
6060

61-
final public class EnumDecl: NominalTypeDecl {}
61+
final public class EnumDecl: NominalTypeDecl {
62+
public var hasRawType: Bool { bridged.Enum_hasRawType() }
63+
}
6264

6365
final public class StructDecl: NominalTypeDecl {
6466
public var hasUnreferenceableStorage: Bool { bridged.Struct_hasUnreferenceableStorage() }

include/swift/AST/ASTBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ struct BridgedDeclObj {
402402
BRIDGED_INLINE bool GenericType_isGenericAtAnyLevel() const;
403403
BRIDGED_INLINE bool NominalType_isGlobalActor() const;
404404
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE OptionalBridgedDeclObj NominalType_getValueTypeDestructor() const;
405+
BRIDGED_INLINE bool Enum_hasRawType() const;
405406
BRIDGED_INLINE bool Struct_hasUnreferenceableStorage() const;
406407
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedASTType Class_getSuperclass() const;
407408
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedDeclObj Class_getDestructor() const;

include/swift/AST/ASTBridgingImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ OptionalBridgedDeclObj BridgedDeclObj::NominalType_getValueTypeDestructor() cons
221221
return {getAs<swift::NominalTypeDecl>()->getValueTypeDestructor()};
222222
}
223223

224+
bool BridgedDeclObj::Enum_hasRawType() const {
225+
return getAs<swift::EnumDecl>()->hasRawType();
226+
}
227+
224228
bool BridgedDeclObj::Struct_hasUnreferenceableStorage() const {
225229
return getAs<swift::StructDecl>()->hasUnreferenceableStorage();
226230
}

0 commit comments

Comments
 (0)