You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of the internal representation in stage1 and the lack of any memory model at all (I'm not talking about more complicated memory models around concurrency and atomicity), values in comptime cannot be casted at all. This is the root problem of #382 for example.
struct ZigValue {
ZigType *type;
ConstValSpecial special;
uint32_t llvm_align;
ConstParent parent;
LLVMValueRef llvm_value;
LLVMValueRef llvm_global;
union {
// populated if special == ConstValSpecialLazy
LazyValue *x_lazy;
// populated if special == ConstValSpecialStatic
BigInt x_bigint;
BigFloat x_bigfloat;
float16_t x_f16;
float x_f32;
double x_f64;
float128_t x_f128;
bool x_bool;
ConstBoundFnValue x_bound_fn;
ZigType *x_type;
ZigValue *x_optional;
ConstErrValue x_err_union;
ErrorTableEntry *x_err_set;
BigInt x_enum_tag;
ConstStructValue x_struct;
ConstUnionValue x_union;
ConstArrayValue x_array;
ConstPtrValue x_ptr;
ConstArgTuple x_arg_tuple;
Buf *x_enum_literal;
// populated if special == ConstValSpecialStaticRaw
Buf *dataSlice;
// populated if special == ConstValSpecialRuntime
RuntimeHintErrorUnion rh_error_union;
RuntimeHintOptional rh_maybe;
RuntimeHintPtr rh_ptr;
RuntimeHintSlice rh_slice;
} data;
// For doing memory actions during comptime
// if special == ConstValSpecialStaticRaw contain owner of data (if any)
ZigValue *owner;
// uncomment this to find bugs. can't leave it uncommented because of a gcc-9 warning
//ZigValue& operator= (const ZigValue &other) = delete; // use copy_const_val
ZigValue(const ZigValue &other) = delete; // plz zero initialize with ZigValue val = {};
// for use in debuggers
void dump();
};
The text was updated successfully, but these errors were encountered:
Because of the internal representation in stage1 and the lack of any memory model at all (I'm not talking about more complicated memory models around concurrency and atomicity), values in comptime cannot be casted at all. This is the root problem of #382 for example.
The text was updated successfully, but these errors were encountered: