mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Const Enums From / to ordinal using casts is back. Add "--use-old-enums", deprecating lookup.
This commit is contained in:
committed by
Christoffer Lerno
parent
4a803ed0cf
commit
13bb2b6690
@@ -44,6 +44,7 @@ fn uint128? int_from_any(any arg, bool *is_neg) @private
|
||||
*is_neg = false;
|
||||
return (uint128)(uptr)*(void**)arg.ptr;
|
||||
case DISTINCT:
|
||||
case CONST_ENUM:
|
||||
return int_from_any(arg.as_inner(), is_neg);
|
||||
default:
|
||||
break;
|
||||
@@ -94,7 +95,7 @@ fn FloatType? float_from_any(any arg) @private
|
||||
$if env::F128_SUPPORT:
|
||||
if (arg.type == float128.typeid) return (FloatType)*((float128*)arg.ptr);
|
||||
$endif
|
||||
if (arg.type.kindof == TypeKind.DISTINCT)
|
||||
if (arg.type.kindof == DISTINCT || arg.type.kindof == CONST_ENUM)
|
||||
{
|
||||
return float_from_any(arg.as_inner());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user