Deprecate MyEnum.elements.

This commit is contained in:
Christoffer Lerno
2025-05-16 16:12:37 +02:00
parent 91db6ceeda
commit b7ae5dce8b
8 changed files with 14 additions and 13 deletions

View File

@@ -24,11 +24,9 @@ struct SliceRaw
macro @enum_lookup($Type, #value, value)
{
var $elements = $Type.elements;
$for var $i = 0; $i < $elements; $i++:
var $val = $Type.from_ordinal($i);
$foreach $val : $Type.values:
if ($val.#value == value) return $val;
$endfor
$endforeach
return NOT_FOUND?;
}