diff --git a/std/comptime/type.jule b/std/comptime/type.jule index f8b8c9119..2916fc043 100644 --- a/std/comptime/type.jule +++ b/std/comptime/type.jule @@ -59,7 +59,7 @@ impl comptimeTypeInfo { fn Bits(self): int // Returns comptimeTypeInfo for element type. - // Supports only pointers (except unsafe pointer), smart pointers, arrays, and slices. + // Supports only pointers (except unsafe pointer), smart pointers, arrays, slices, and enums. fn Elem(self): comptimeTypeInfo // Returns size of array. diff --git a/std/jule/sema/comptime.jule b/std/jule/sema/comptime.jule index 2ea772fea..207ae0844 100644 --- a/std/jule/sema/comptime.jule +++ b/std/jule/sema/comptime.jule @@ -281,6 +281,10 @@ impl comptimeType { if array != nil { ret buildComptimeTypeInfoData(e.s, array.Elem) } + let mut enm = self.base.Enum() + if enm != nil { + ret buildComptimeTypeInfoData(e.s, enm.Kind.Kind) + } e.pushErr(fc.Token, LogMsg.InvalidTypeForFn, self.base.Str(), "Elem") ret nil }