Change Log: 2.110.0
Download D 2.110.0 Beta
to be released Aug 01, 2024
Compiler changes
List of all bug fixes and enhancements in D 2.110.0.
Compiler changes
- Copying from const(void)[] to void[] is disallowed with -preview=fixImmutableConv
If const(void)[] data contains tail const pointers, copying to void[] can subsequently violate const data:
void f(int*[] a, const int*[] b) { void[] va = a; const void[] vb = b; va[] = vb[]; // fills `a` with pointers to const *a[0] = 0; // const data mutated }
Copying vb data to va is no longer allowed with the -preview=fixImmutableConv switch.
- Import expressions are now treated as hex strings
While Import expressions are typed as string, they are also used to embed binary files. By treating them the same as hex strings, they will implicitly convert to arrays of integral types other than char.
// Formerly, a cast was required: immutable ubyte[] iconImg = cast(immutable ubyte[]) import("icon.png"); // Now, it implicitly converts to integral arrays: immutable ubyte[] iconImg = import("icon.png");
- bool values other than 0 or 1 are not @safe
The spec was updated (for 2.109) so that only 0 and 1 are safe values for bool. This means that reading a bool value whose underlying byte representation has other bits set is implementation-defined and should be avoided. Consequently the following are deprecated in @safe code:
- void initialization of booleans (since 2.109)
- Reading a bool field from a union (since 2.109)
- Runtime casting a dynamic array to a bool dynamic array type
- Runtime casting a bool dynamic array to a tail mutable dynamic array type
- Casting a pointer to a bool pointer type
- Casting a bool pointer to a tail mutable pointer type
Dub changes
- dub.selections.json files are now looked up in parent directories too
In case the root package directory doesn't contain a dub.selections.json file, dub now looks in parent directories too and potentially uses the first (deepest) one it finds - if and only if that JSON file contains an optional new "inheritable": true flag.
This allows using a 'central' dub.selections.json file for a repository containing multiple dub projects, making it automatically apply to all builds in that source tree if located in the repository root directory (unless a local dub.selections.json overrides it).
Such an inherited selections file is never mutated when running dub for a nested project, i.e., changes are always saved to a local dub.selections.json file. E.g., when running dub upgrade for a nested project.
List of all bug fixes and enhancements in D 2.110.0:
DMD Compiler bug fixes
- Bugzilla 12885: const union wrongly converts implicitly to mutable
- Bugzilla 17148: Copying from const(void)[] to void[] breaks immutable
- Bugzilla 23957: Casting to derived extern(C++) class is unsafe
- Bugzilla 24534: Having a label on a declaration makes it possible to skip it with goto
- Bugzilla 24558: C asserts segfault on Glibc
- Bugzilla 24577: Struct with constructor returned from C++ wrong
- Bugzilla 24582: Detect unsafe cast(bool[])
- Bugzilla 24583: di generator emits return scope and scope return in wrong order
- Bugzilla 24592: ImportC: Bitfield layout wrong for int64 on 32-bit Linux
- Bugzilla 24594: ImportC: Packed struct has wrong layout
- Bugzilla 24603: Can copy from non-void array into void[] in safe code
- Bugzilla 24622: Modify const data with void[] concatenation/append
- Bugzilla 24630: Casting a bool pointer to a mutable pointer type is unsafe
- Bugzilla 24631: Pointer cast allows changing @system field in @safe code
- Bugzilla 24634: Parse error initializing array from expression with StructInitializer
DMD Compiler enhancements
- Bugzilla 20243: inout not substituted for in associative array key type
- Bugzilla 24135: Eponymous template member overloads not shown as call candidates
- Bugzilla 24580: ImportC: Asm label after attributes results in syntax error
- Bugzilla 24598: OpenBSD: adapt compiler tests
- Bugzilla 24623: Rename version CppRuntime_Clang/Gcc to CppRuntime_libcxx/libstdcxx.
Phobos bug fixes
- Bugzilla 24564: std.file.DirEntry throws Exception instead of FileException
Druntime bug fixes
- Bugzilla 24579: stat_t has wrong size for Android armv7a
- Bugzilla 24626: hasUDA does not handle multiple UDAs of the same symbol
Druntime enhancements
- Bugzilla 24590: Illegal instruction with module constructors cycle and shared libphobos2 in _d_criticalenter2
dlang.org bug fixes
- Bugzilla 24543: The @__future attribute is (almost) undocumented
- Bugzilla 24548: [spec] Boolean condition conversion is not documented
- Bugzilla 24565: out contract variable is implicitly const
Installer bug fixes
- Bugzilla 24600: DMD nightly builds are outdated
Contributors to this release (27)
A huge thanks goes to all the awesome people who made this release possible.
- 0-v-0
- 0v0
- Alex Muscar
- Andrei Horodniceanu
- Ben Jones
- Brad Roberts
- Brian Callahan
- Connor
- Dennis
- Dennis Korpel
- Emmanuel Nyarko
- Iain Buclaw
- Jeremy Baxter
- Johan Engelen
- Jonathan M Davis
- Martin Kinkelin
- Mathias Lang
- Nicholas Wilson
- Nick Treleaven
- Paul Backus
- Quirin F. Schroll
- Quirin Schroll
- Razvan Nitu
- ryuukk
- Tim Schendekehl
- Walter Bright
- zopsicle