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.086.0

previous version: 2.085.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,, 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 and running the pending_changelog target:
    make -f posix.mak pending_changelog

2.086.0 comes with 10 major changes and 32 fixed Bugzilla issues. A huge thanks goes to the 40 contributors who made 2.086.0 possible.

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

Compiler changes

  1. Turn deprecation into error for privately imported symbols inside aggregate declarations

    With this release DMD will issue an error when a symbol that is privately imported in the scope of an aggregate declaration is used as a member of the aggregate outside of the module where the aggregate is defined. Example:

    // a.d
    class Foobar
        int a;
        this(int a)
            this.a = a;
        static int smeth()
            return 1;
    void fun() {}
    // b.d
    struct AST
        import a;
    // c.d
    void main()
        import b;
        AST.Foobar t;        // triggered a deprecation, but will now trigger an error
        AST.Foobar.smeth();  // error;           // error
  2. Turn deprecation into error for selectively imported symbols in imported modules.

    With this release DMD will issue an error when a symbol that is privately and selectively imported in module A is accessed in module B that imports module A non-selectively. Example:

    // a.d
    import fun : foo;
    // b.d
    import a;
    void main()
        foo();     // deprecation up until now; error from now on

    To make the above code compile, the import in a.d needs to be made public.

  3. New command-line option -lowmem to reduce compiler memory requirements

    It enables the garbage collector for the compiler, trading compile times for (in some cases, significantly) less memory requirements.

    E.g., compiling DMD's test tool d_do_test (dmd -c [-lowmem] test/tools/d_do_test.d) requires about 75% less memory (~1,630 MB -> 410) at the cost of a runtime increase by ~30% (~4.8 secs -> 6.3).

Runtime changes

  1. New module core.sync.event

    This module provides a cross-platform interface for lightweight signaling of other threads. It can be used to start execution of multiple waiting threads simultaneously.

Library changes

  1. Fixed comparison bug in std.algorithm.comparison.levenshteinDistance

    Previously the algorithm was allocating the amount of memory which was equal to the size of the biggest range, that is Ο(max(s.length, t.length)). This is now fixed to be Ο(min(s.length, t.length)). For more details see std.algorithm.comparison.levenshteinDistance.

  2. std.experimental.all has been moved to std

    std.experimental.all allowed the convenient use of all Phobos modules with one import (import std.experimental.all;). With this release, this convenience module has been stabilized and moved to std. From now on, the convenience module can be accessed with import std;:

    import std;
    void main()
    {!exp2.sum; // 31

    Scripts and experimental code often use long and frequently changing lists of imports from the standard library.

    With this release it is possible to use import std; for importing the entire standard library at once. This can be used for fast prototyping or REPLs:

    import std;
    void main()
          .filter!(a => a % 2) // 1 3 5
          .map!(a => a * 2) // 2 6 10
          .tee!writeln // peek into the processed stream
          .substitute(6, -6) // 2 -6 10
          .mean // (2 - 6 + 10) / 3
          .reverseArgs!writefln("Sum: %.2f"); // 2

    As before, symbol conflicts will only arise if a symbol with collisions is used. In this case, static imports or renamed imports can be used to uniquely select a specific symbol.

    The baseline cost for import std; is less than half a second (varying from system to system) and work is in progress to reduce this overhead even further.

Dub changes

  1. Support of custom dub init type

    Command dub init now supports custom dub packages for argument -t.

    > dub init -n myPackage --format sdl -t custom-dub-init-dubpackage -- --foo=bar

    Dub init will be invoked like before. The package custom-dub-init-dubpackage contains a sub package init-exec which will be invoked afterwards to create a custom package skeleton. Additional arguments could be passed e.g. -- --foo=bar.

  2. DUB will no longer use OPTLINK as default on Windows

    DMD's OPTLINK has many limitations. Apart from long-standing issues in the underlying DigitalMars runtime, the maximum number of symbols is limited as well, which is why most big DUB libraries can't be compiled with OPTLINK for years. This has been a cause of grief and pain for many users and impacted the newcomer experience severly.

    With this release, dub will no longer use OPTLINK as default on Windows, but use -m32mscoff (MSCOFF) on 32-bit Windows systems and -m64 (MSCOFF) on 64-bit Windows.

    Users can still manually instruct dub to use OPTLINK with the --arch=x86 switch of dub:

    > dub --arch=x86

  3. dub run will now automatically fetch a package if it's not found locally

    Starting with this release, dub run <mypackage> makes sure that the package is available locally. This means that now a dub fetch <mypackage> is no longer required and all a user of a library needs to run your dub package is dub run:

    > dub run gitcompatibledubpackage
    gitcompatibledubpackage wasn't found locally, but it's available online:
    Description: Example of a DUB package also usable as git submodule. For DUB test suite.
    Version: 1.0.4

    Do you want to fetch gitcompatibledubpackage? [Y/n]:

    An optional --yes (-y) flag is provided for non-interactive use:

    > dub run --yes gitcompatibledubpackage
    gitcompatibledubpackage wasn't found locally, but it's available online:
    Description: Example of a DUB package also usable as git submodule. For DUB test suite.
    Version: 1.0.4

    Fetching gitcompatibledubpackage 1.0.4... Building package gitcompatibledubpackage in /home/seb/.dub/packages/gitcompatibledubpackage-1.0.4/gitcompatibledubpackage/ Performing "debug" build using dmd for x86_64. gitcompatibledubpackage 1.0.4: building configuration "exe"... Linking... Running ../../.dub/packages/gitcompatibledubpackage-1.0.4/gitcompatibledubpackage/gitcompatibledubpackage Hello DUB

    If one wants to run a specific version of a package, it can be passed to dub run too:

    > dub run gitcompatibledubpackage@1.0.3
    Fetching gitcompatibledubpackage 1.0.3...
    Building package gitcompatibledubpackage in /home/seb/.dub/packages/gitcompatibledubpackage-1.0.3/gitcompatibledubpackage/
    Performing "debug" build using dmd for x86_64.
    gitcompatibledubpackage 1.0.3: building configuration "exe"...
    Running ../../.dub/packages/gitcompatibledubpackage-1.0.3/gitcompatibledubpackage/gitcompatibledubpackage
    Hello DUB

  4. Remove dub list-installed command

    dub list-installed command was deprecated and renamed to list at in 2013.

List of all bug fixes and enhancements in D 2.086.0:

DMD Compiler regressions

  1. Bugzilla 17684: [REG 2.062] static alias this bug or incomplete implementation?
  2. Bugzilla 19691: ICE on null default value for struct parameter in constructor
  3. Bugzilla 19718: DMD 2.085 changes to gsroa make DCD crashing
  4. Bugzilla 19722: botched implementation of semantic3Errors causes compiler assert fail

DMD Compiler bugs

  1. Bugzilla 11934: Allow ref in foreach over range iff front returns by ref
  2. Bugzilla 15875: case of undetected circular reference in function parameter
  3. Bugzilla 17285: Segfault when types are used in array literals
  4. Bugzilla 17289: With Xcode 8.3 linker, warnings of "pointer not aligned"
  5. Bugzilla 17290: DMD crash due to circular reference in function return type
  6. Bugzilla 17651: Segfault when parsing Ddoc ESCAPES macro
  7. Bugzilla 18573: cast(void) leads to floating point return value not being popped from FPU stack
  8. Bugzilla 19563: extern(C++) Incorrect ABI passing small struct
  9. Bugzilla 19569: overload resolution not right?
  10. Bugzilla 19679: variable escapes unnoticed when referenced in function called from function whose address is taken
  11. Bugzilla 19688: [ICE] Default function argument concatenation crashes DMD
  12. Bugzilla 19700: [2.085.0-beta.2] Obj-C wrong code overloading selectors and extern(D)
  13. Bugzilla 19717: case of segfault due to undetected forward reference
  14. Bugzilla 19731: auto struct methods whose address is taken don't test invariants
  15. Bugzilla 19734: isDataseg returns true for non-static declarations
  16. Bugzilla 19735: Error: variable extern symbols cannot have initializers
  17. Bugzilla 19744: Confusing error message when annotating a non-member function with return
  18. Bugzilla 19747: No debug line info for code in scope(exit)

DMD Compiler enhancements

  1. Bugzilla 19441: alias this causes partial assignment

Phobos bugs

  1. Bugzilla 18728: std.math.fdim does not handle nan correctly
  2. Bugzilla 19042: Chunking a padRight'ed range leads to range violations
  3. Bugzilla 19151: std.utf.toUTF16z() can not be used for LPWSTR
  4. Bugzilla 19681: std.range.padRight.popFront does not correctly adjust length
  5. Bugzilla 19689: large types cannot be moved
  6. Bugzilla 19751: std.stdio.File should not retry fclose after error

Phobos enhancements

  1. Bugzilla 15853: std.random save methods must be const
  2. Bugzilla 18806: minIndex should be able to take an input range but does not
  3. Bugzilla 19686: sgn is too greedy

Contributors to this release (40)

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

previous version: 2.085.0