0.7.1 Change list
Changes / improvements
- Better errors on some common casting mistakes (pointer->slice, String->ZString, deref pointer->array) #2064.
- Better errors trying to convert an enum to an int and vice versa.
- Function
@requirechecks are added to the caller in safe mode. #186 - Improved error message when narrowing isn't allowed.
- Operator overloading for
+ - * / % & | ^ << >> ~ == != += -= *= /= %= &= |= ^= <<= >>= - Add
@operator_rand@operator_sattributes. - More stdlib tests:
sincos,ArenaAllocator,Slice2d. - Make aliases able to use
@deprecated. - Refactored stdlib file organization.
- Allow
@ifon locals. - String str = "" is now guaranteed to be null terminated. #2083
- Improved error messages on
Foo { 3, abc }#2099. Foo[1..2] = { .baz = 123 }inference now works. #2095- Deprecated old inference with slice copy. Copying must now ensure a slicing operator at the end of the right hand side:
foo[1..2] = bar[..]rather than the oldfoo[1..2] = bar. The old behaviour can be mostly retained with--use-old-slice-copy). - Added
Enum.lookupandEnum.lookup_field. c3c buildpicks first target rather than the first executable #2105.- New Win32 Mutex, ConditionVariable and OnceFlag implementation
Fixes
- Trying to cast an enum to int and back caused the compiler to crash.
- Incorrect rounding at compile time going from double to int.
- Regression with invalid setup of the WASM temp allocator.
- Correctly detect multiple overloads of the same type.
- ABI bug on x64 Linux / MacOS when passing a union containing a struct of 3 floats. #2087
- Bug with slice acces as inline struct member #2088.
@ifnow does implicit conversion to bool like$if. #2086- Fix broken enum inline -> bool conversions #2094.
@ifwas ignored on attrdef, regression 0.7 #2093.@ensurewas not included when the function doesn't return a value #2098.- Added missing
@clone_alignedand add checks to@tclone - Comparing a distinct type with an enum with an inline distinct type failed unexpectedly.
- The
%swould not properly print function pointers. - Compiler crash when passing an untyped list as an argument to
assert#2108. @ensureshould be allowed to read "out" variables. #2107- Error message for casting generic to incompatible type does not work properly with nested generics #1953
- Fixed enum regression after 0.7.0 enum change.
- ConditionVariable now properly works on Win32
Stdlib changes
- Hash functions for integer vectors and arrays.
- Prefer
math::Iandmath::I_Fformath::IMAGINARYandmath::IMAGINARYFthe latter is deprecated. - Add
array::containsto check for a value in an array or slice.