@@ -27,6 +27,7 @@ public struct Type : TypeProperties, CustomStringConvertible, NoReflectionChildr
2727
2828 public var isAddress : Bool { bridged. isAddress ( ) }
2929 public var isObject : Bool { !isAddress }
30+ public var category : ValueCategory { ValueCategory ( bridged: bridged. getCategory ( ) ) }
3031
3132 public var addressType : Type { bridged. getAddressType ( ) . type }
3233 public var objectType : Type { bridged. getObjectType ( ) . type }
@@ -214,6 +215,16 @@ public struct Type : TypeProperties, CustomStringConvertible, NoReflectionChildr
214215 }
215216 return false
216217 }
218+
219+ public func getEnumCasePayload( caseIdx: Int , function: Function ) -> Type {
220+ bridged. getEnumCasePayload ( caseIdx, function. bridged) . type
221+ }
222+
223+ public func mapTypeOutOfContext( ) -> Type { bridged. mapTypeOutOfContext ( ) . type }
224+
225+ public static func getPrimitiveType( canType: CanonicalType , silValueCategory: ValueCategory ) -> Type {
226+ BridgedType . getPrimitiveType ( canType: canType. bridged, silValueCategory: silValueCategory. _bridged) . type
227+ }
217228}
218229
219230extension Type : Equatable {
@@ -266,6 +277,7 @@ public struct NominalFieldsArray : RandomAccessCollection, FormattedLikeArray {
266277}
267278
268279public struct EnumCase {
280+ public let enumElementDecl : EnumElementDecl
269281 public let payload : Type ?
270282 public let index : Int
271283}
@@ -288,7 +300,8 @@ public struct EnumCases : CollectionLikeSequence, IteratorProtocol {
288300 caseIterator = caseIterator. getNext ( )
289301 caseIndex += 1
290302 }
291- return EnumCase ( payload: enumType. bridged. getEnumCasePayload ( caseIterator, function. bridged) . typeOrNil,
303+ return EnumCase ( enumElementDecl: enumType. bridged. getEnumElementDecl ( caseIterator) . getAs ( EnumElementDecl . self) ,
304+ payload: enumType. bridged. getEnumCasePayload ( caseIterator, function. bridged) . typeOrNil,
292305 index: caseIndex)
293306 }
294307 return nil
@@ -304,6 +317,10 @@ public struct TupleElementArray : RandomAccessCollection, FormattedLikeArray {
304317 public subscript( _ index: Int ) -> Type {
305318 type. bridged. getTupleElementType ( index) . type
306319 }
320+
321+ public func label( at index: Int ) -> swift . Identifier {
322+ type. bridged. getTupleElementLabel ( index)
323+ }
307324}
308325
309326public struct BoxFieldsArray : RandomAccessCollection , FormattedLikeArray {
0 commit comments