Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

Change Log: 2.104.0

previous version: 2.103.0

Download D nightlies
To be released


This changelog has been automatically generated from all commits in master since the last release.

  • The full-text messages are assembled from the changelog/ directories of the respective repositories: dmd, druntime, phobos, tools, dlang.org, installer, and dub.
  • See the DLang-Bot documentation for details on referencing Bugzilla. The DAutoTest PR preview doesn't include the Bugzilla changelog.
  • The pending changelog can be generated locally by setting up dlang.org and running the pending_changelog target:
    make -f posix.mak pending_changelog


2.104.0 comes with 8 major changes and 69 fixed Bugzilla issues. A huge thanks goes to the 38 contributors who made 2.104.0 possible.

List of all upcoming bug fixes and enhancements in D 2.104.0.

Compiler changes

  1. Add __check(assign-expression) to ImportC

    C code normally relies on #include <assert.h> to add support for assert's. D has them builtin to the language, which is much more convenient and does not rely on a preprocessor. This extension adds

    __check(assign-expression)
    

    as an expression to ImportC. The compiler switch -checkaction=C gives it the same behavior as C's assert macro. If the compiler switch -release is thrown, the __check's are ignored. The __check expressions are handy for writing C programs that are free of reliance on #include.

    __assert is not used due to conflicts with some C .h files.

  2. Alias this for classes is deprecated

    Using alias this for classes has not been clearly specified and the lookup rules in such circumstances are not defined. As a consequence, various failures or crashes may appear when alias this is used in conjunction with classes. Starting with this release, alias this for classes is being deprecated. As an alternative, getter/setter methods may be used to replace the alias this. This can be generically handled by:

    static foreach(member, __traits(allMembers, LeClass))
        mixin("ref auto " ~ member() { return $field_name." ~ member ~ "; }");
    
  3. -preview=dip25 has been enabled by default

    Deprecation warnings for DIP25 violations have been enabled since 2.092. Starting with this release, it will report errors, unless the -revert=dip25 switch is used. Using the switch (or its short version -dip25) is now deprecated.

    ref int escapeRef(ref int x) {return x;}
    
    // Formerly:
    // Deprecation: returning `x` escapes a reference to parameter `x`
    //        perhaps annotate the parameter with `return`
    //
    // Now it is an error, unless `-revert=dip25` is used
    
  4. export int a; now generates dllexport instead of dllimport

    In order to make it dllimport, use:

    export extern int a;
    
  5. Deprecate traits(isVirtualFunction) and traits(getVirtualFunctions)

    Up until this release, D had both traits(isVirtualFunction) and traits(isVirtualMethod) (and their coressponding traits(get...) counterpart). The differenrcte between the two is that isVirtualFunction returns true for final methods that do not override anything. This is in contradiction with the D spec which states that final functions that do not override other functions cannot be virtual. isVirtualMethod correctly returns false in that case.

    Starting with this release, both traits(isVirtualFunction) and traits(getVirtualFunctions) are deprecated. If the behavior of traits(isVirtualFunction) is desired, it can be achieved by traits(isVirtualMethod, f) || (traits(isFinalFunction, f) && !traits(isOverrideFunction, f)).

Library changes

  1. Unicode grapheme walking updated to conform to Unicode version 15

    Up until now graphemeStride, byGrapheme and decodeGrapheme functions in std.uni have used obsolete rules from earlier Unicode standards.

    This release brings grapheme breaking rules up to date with Unicode version 15. This means Phobos functions now recognise extended pictogram sequences and prepend characters.

  2. Better static assert messages for std.algorithm.iteration.joiner

    Up until now filter used a template constraint to check if the passed Data could be used. If it were not, it was very tedious to figure out why.

    As the template constraint is not used to overload the symbol template function, the constrains are move into static asserts with expressive error messages.

  3. Better static assert messages for std.algorithm.sorting.sort

    Up until now sort used a template constraint to check if the passed Range could be used. If it were not, it was very tedious to figure out why.

    As the template constraint is not used to overload the symbol template function, the constrains are move into static asserts with expressive error messages.


List of all bug fixes and enhancements in D 2.104.0:

DMD Compiler regression fixes

  1. Bugzilla 20090: Header generation wrongfully outputs constructor bodies
  2. Bugzilla 23764: Message printed twice: Usage of in on parameter
  3. Bugzilla 23816: Typing invalid mnemonic in asm{} block segfaults
  4. Bugzilla 23832: dmd regression 2.103.0 silent error cannot call decode at runtime
  5. Bugzilla 23874: -profile=gc segfaults / ICE regression
  6. Bugzilla 23882: ICE (segfault) on nasty alias this code
  7. Bugzilla 23905: Initialization of SumType with opaque enum causes ICE
  8. Bugzilla 23913: __traits(getMember) fails for some C symbols

DMD Compiler bug fixes

  1. Bugzilla 12118: Modify immutable data using throw
  2. Bugzilla 18493: [betterC] Can't use aggregated type with postblit
  3. Bugzilla 19454: Name collisions with unnamed function parameters
  4. Bugzilla 19706: Attribute inference in struct fails
  5. Bugzilla 20737: TLS variables unusable with -betterC for Windows MSVC targets
  6. Bugzilla 21667: scope parameter causes 'no size because of forward references'
  7. Bugzilla 22739: Segmentation fault in CppMangleVisitor.headOfType
  8. Bugzilla 22760: Segmentation fault in CppMangleVisitor.template_arg
  9. Bugzilla 22765: Assertion failure in CppMangleVisitor.template_args
  10. Bugzilla 22785: joiner does not support range over immutable
  11. Bugzilla 22857: Segfault for malformed static if in imported template
  12. Bugzilla 22960: importC: K&R-style functions assume variadic calling convention
  13. Bugzilla 23014: importC: static thread-locals do not work
  14. Bugzilla 23055: importC: using compound-literal array as pointer in CTFE gives 'dereference of invalid pointer'
  15. Bugzilla 23402: importc function definitions from includes can cause D name conflicts
  16. Bugzilla 23427: ImportC: some bitfield combinations lead to wrong size struct
  17. Bugzilla 23509: ImportC: need statement expressions extension for GLibC's assert()
  18. Bugzilla 23691: compilable/test22294.i:16:1: control Z interpreted as end of file
  19. Bugzilla 23715: ImportC: No rejection of _Thread_local variables declared at function scope without 'static' as per C11 6.2.4-5
  20. Bugzilla 23727: ImportC support imaginary real numbers
  21. Bugzilla 23784: ImportC: __ptr32, __ptr64
  22. Bugzilla 23787: ImportC: __unaligned
  23. Bugzilla 23789: ImportC: __declspec(align(n))
  24. Bugzilla 23795: Cannot cast _Complex!double to _Complex!float
  25. Bugzilla 23801: ImportC: enumeration constant does not fit in an int
  26. Bugzilla 23802: ImportC: __volatile__ is yet another alias for volatile
  27. Bugzilla 23808: #include is not working with importc
  28. Bugzilla 23822: Deprecated struct alias ignored completely
  29. Bugzilla 23826: Deprecated type member passed to template doesn't warn
  30. Bugzilla 23836: Two errors printed for typeof(super) in non-static member context
  31. Bugzilla 23837: importc fails to link on windows x86 but successes on x64
  32. Bugzilla 23838: DMD lexer / parser examples might not compile
  33. Bugzilla 23861: Compiler segmentation fault with ref and alias this
  34. Bugzilla 23863: typeof rejects AliasSeq!() as argument
  35. Bugzilla 23866: ImportC: Multiple __declspecs rejected
  36. Bugzilla 23867: ImportC: undefined identifier __builtin_isnan
  37. Bugzilla 23869: ImportC: undefined identifier isfinite
  38. Bugzilla 23873: [ICE] segfault on imported static if ; else auto x
  39. Bugzilla 23885: [CI] C++ interop tests with g++ fail

DMD Compiler enhancements

  1. Bugzilla 13577: More informative error message for refused immutable foreach loop
  2. Bugzilla 17374: Improve inferred attribute error message
  3. Bugzilla 20268: anonymous function parameter mismatch errors don't include parameters
  4. Bugzilla 22559: ImportC: support gnu case ranges
  5. Bugzilla 23401: ImportC: add -cpp=filename switch to select C preprocessor
  6. Bugzilla 23862: with statement should accept an expression with enum type

Phobos bug fixes

  1. Bugzilla 19642: std.range.slide!(No.withPartial) on lengthless forward range: get empty when expecting one window
  2. Bugzilla 22147: DList can't accept a struct with postblit disabled
  3. Bugzilla 22786: maxElement et al does not support range over immutable
  4. Bugzilla 23834: std.file : File links to c functions are invalid and need updating
  5. Bugzilla 23846: std.math can't compile under macos rosetta

Phobos enhancements

  1. Bugzilla 6106: Keep track of changes during replace function
  2. Bugzilla 14478: isInputRange should allow ranges of non-copyable elements
  3. Bugzilla 23769: Lambda isn't a unary predicate for lambda that doesn't compile

Druntime regression fixes

  1. Bugzilla 23859: [REG 2.103] Throwing while in a deep callstack causes memory corruption

Druntime bug fixes

  1. Bugzilla 14891: profilegc_setlogfilename w/o null-terminated string might fail during fopen
  2. Bugzilla 23949: core.stdc.assert_ for FreeBSD and DragonFlyBSD is incorrect

Druntime enhancements

  1. Bugzilla 11989: Phase out TickDuration

dlang.org bug fixes

  1. Bugzilla 14932: The language specification does not define what the shared attribute does
  2. Bugzilla 23698: ImportC: __stdcall is not documented as supported MSVC/DMC extensions
  3. Bugzilla 23699: ImportC: Unclear documentation that struct/union/enum introduce implicit typedefs
  4. Bugzilla 23872: Wrong example in Interfacing to C: Calling printf section

Contributors to this release (38)

A huge thanks goes to all the awesome people who made this release possible.

previous version: 2.103.0