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

previous version: 2.084.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.085.0 comes with 15 major changes and 62 fixed Bugzilla issues. A huge thanks goes to the 50 contributors who made 2.085.0 possible.

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

Compiler changes

  1. Aliases can be created directly from a __trait.

    Aliases can be created directly from the traits that return symbol(s) or tuples. This includes getMember, allMembers, derivedMembers, parent, getOverloads, getVirtualFunctions, getVirtualMethods, getUnitTests, getAttributes and finally getAliasThis. Previously an AliasSeq was necessary in order to alias their return. Now the grammar allows to write shorter declarations:

    struct Foo
    {
        static int a;
    }
    
    alias oldWay = AliasSeq!(__traits(getMember, Foo, "a"))[0];
    alias newWay = __traits(getMember, Foo, "a");
    

    To permit this it was more interesting to include __trait in the basic types rather than just changing the alias syntax. So additionally, wherever a type appears a __trait can be used, for example in a variable declaration:

    struct Foo { static struct Bar {} }
    const(__traits(getMember, Foo, "Bar")) fooBar;
    static assert(is(typeof(fooBar) == const(Foo.Bar)));
    
  2. Added -check switch to turn on and off each category of runtime checks.

    Option("check=[assert|bounds|in|invariant|out|switch][=[on|off]]", `Overrides default, -boundscheck, -release and -unittest options to enable or disable specific checks.

    • assert: assertion checking
    • bounds: array bounds
    • in: in contracts
    • invariant: class/struct invariants
    • out: out contracts
    • switch: switch default
    • on or not specified: specified check is enabled.
    • off: specified check is disabled.
    ` )

  3. Add -checkaction=D|C|halt compiler switch.

    It covers action taken when an assert fails, a bounds check fails, or a final switch error happens. D means the usual D behavior of throwing an Error, C means call the C runtime library assert failure function, and halt means halt the program execution.

    The halt is the main addition here, it enables very lightweight assert's.

  4. -color and -color=on will now always output colorized console output

    Before this release -color wouldn't output colorized console output if the terminal detection failed. With this release, a new option auto is introduced for -color=<value> which will continue to be the default:

    • auto: enable colorized output if a tty is detected (default)
    • on: always use colored output.
    • off: never use colored output.

    Hence, it is now possible to use -color (a shortcut for -color=on) to force DMD to emit colorized console output. For example, this will now use colorized console output:

    > echo $(echo "test" | dmd -color - 2>&1)
    __stdin.d(2): Error: no identifier for declarator test
    

  5. The code generated by mixin statements can now be saved with -mixin

    This is useful to debug errors in compilation and provides source for debuggers to show when requested.

  6. Deprecate invalid binary literals

    Prior to this release, binary literals without any digits after the prefix 0b were considered valid. This has now been deprecated.

    auto foo = 0b;   // deprecated
    auto bar = 0b_;  // deprecated
    auto baz = 0b0;  // conforming equivalent
    
  7. Deprecated extern(Pascal) linkage

    This linkage is completely unused, being an heritage from a few decades ago. Additionally, it's only supported by DMD and cause mangling ambiguity.

  8. The deprecation phase for fully qualified names that bypassed private imports is finished
    // a.d
    import std.stdio;
    
    // b.d
    import a;
    
    void main()
    {
        std.stdio.writefln("foo");         // deprecation before patch, now errors
    }
    

    In order to compile the example successfully, public needs to be added to the import located in a.d : public import std.stdio; or import std.stdio; needs to be added to b.d.

  9. Templates are now mangled correctly on POSIX

    Before this version, anything including extern(C++) templates was not correctly mangled on OSX, Linux, and FreeBSD, leading to linker errors.

  10. Added __c_wchar_t as a correct mangling type for C's wchar_t

    This allows code interfacing with C++ that uses wchar_t to link correctly. It replaces wchar (Windows) and dchar (Posix) as the memory type for the DRuntime alias wchar_t.

Runtime changes

  1. Added core.stdcpp.array.

    Added core.stdcpp.array, which links against C++ std::array

  2. Add D header file core.sys.darwin.crt_externs for libc/crt_externs.h on Darwin.

    Add D header file core.sys.darwin.crt_externs for libc/crt_externs.h on Darwin.

  3. Added initialize template argument to object.destroy().

    object.destroy() now receives an initialize argument to specify whether to re-initialize the object after destruction.

  4. Added core.stdcpp.string_view.

    Added core.stdcpp.string_view, which links against C++ std::string_view

Library changes

  1. Add overload std.random.unpredictableSeed!UIntType

    std.random.unpredictableSeed now has an overloaded version std.random.unpredictableSeed!UIntType that can be used to produce seeds of any unsigned type UIntType.

    import std.random : unpredictableSeed;
    
    auto a = unpredictableSeed!uint;
    static assert(is(typeof(a) == uint));
    
    auto b = unpredictableSeed!ulong;
    static assert(is(typeof(b) == ulong));
    
    // The old syntax still works.
    uint c = unpredictableSeed;
    

    Additionally the implementation quality of unpredictableSeed has been improved, speeding it up and eliminating an obvious pattern in the high bit. (Bear in mind that unpredictableSeed is still not cryptographically secure.)


List of all bug fixes and enhancements in D 2.085.0:

DMD Compiler regressions

  1. Bugzilla 16214: [REG2.069] ICE: Assertion `fd->semanticRun == PASSsemantic3done' failed.
  2. Bugzilla 16652: [Reg 2.071] returned rvalue destroyed too early
  3. Bugzilla 17518: [Reg 2.063] confusing error message with inout constructor/ctor
  4. Bugzilla 18372: REG(2.072): error missing line number: Error: undefined identifier __va_list_tag
  5. Bugzilla 19494: [REG 2.080.0][objc] interface main.NSObject.Class conflicts with interface main.NSObject.Class
  6. Bugzilla 19499: __c_long_double has exact match with double
  7. Bugzilla 19523: "undefined identifier" causes DMD crash
  8. Bugzilla 19618: Incorrect conversion of function returning typeof(null) to function returning an associative array
  9. Bugzilla 19639: Initializing static array with slice enum of different length crashes the compiler
  10. Bugzilla 19652: [REG2.084] alias this chain no longer works
  11. Bugzilla 19654: [REG master] cannot have final methods in objc interfaces
  12. Bugzilla 19672: Function uses the stack to read a static array parameter but it is passed in the registers
  13. Bugzilla 19685: Nested aggregate overlaps not detected

DMD Compiler bugs

  1. Bugzilla 12001: __traits(isSame) does not work with the basic types
  2. Bugzilla 16098: align(32) not respected for stack variables
  3. Bugzilla 17090: dmd -transition=? needs quoting => make it -transition=help
  4. Bugzilla 17181: Local imports in templates should be added to imported modules list of module that instantiated it
  5. Bugzilla 18545: Casting away const with cast() triggers alias this, but returns the supertype anyway
  6. Bugzilla 19223: core.simd __vector.array compiler crash
  7. Bugzilla 19224: core.simd __vector.array "__r2.length cannot be evaluated at compile time"
  8. Bugzilla 19549: -check=in=off doesn't work
  9. Bugzilla 19551: corrupt ELF library when using pragma(crt_constructor)
  10. Bugzilla 19574: DMD crashes with templated structs in two identical extern(C++, "") blocks
  11. Bugzilla 19607: [ICE] dmd/e2ir.d(117): Invalid type mTYconst|TYstruct
  12. Bugzilla 19608: [ICE] dmd/backend/cod1.d(3826): Assertion `0' failed.
  13. Bugzilla 19609: [ICE] dmd/expression.d(2790): Segmentation fault
  14. Bugzilla 19627: [CTFE][SIMD] Error: cannot cast int to int[4]
  15. Bugzilla 19628: [CTFE][SIMD] ICE indexing vector array
  16. Bugzilla 19630: [CTFE][SIMD] Error: cannot determine length of vector slice at compile time
  17. Bugzilla 19676: Destructor not called for returned temporary that was cast to void
  18. Bugzilla 19687: Wrong error for overloaded opDispatch + UFCS with non-existing function
  19. Bugzilla 19699: [2.085.0-beta.2] Obj-C segfault - in objc_glue.getClassName

DMD Compiler enhancements

  1. Bugzilla 16360: DMD fails to inline functions that contain a type
  2. Bugzilla 19097: Extend Return Scope Semantics
  3. Bugzilla 19543: Shared object "libstdc++.so.6" not found, required by "dmd"
  4. Bugzilla 19552: -transition is non-intuitive to use - the flag should list options by default

Phobos bugs

  1. Bugzilla 18519: freebsd 11 + phobos + curl, timing out
  2. Bugzilla 18913: Cannot move static array of non-copyable type
  3. Bugzilla 19532: chunkBy assert error involving non-forward input ranges.
  4. Bugzilla 19572: std.array.Appender.put invokes struct constructor via cast
  5. Bugzilla 19580: [non-DMD] std.random seed bootstrap: don't count on reading an uninitialized variable being treated as an ordinary read
  6. Bugzilla 19644: std.range.takeOne opSlice asserts incorrectly when operating on non-forward input range
  7. Bugzilla 19647: std.range.takeOne opSlice incorrect for empty slice of non-forward input range

Phobos enhancements

  1. Bugzilla 19453: Remove unnecessary error checks in std.datetime.systime.currStdTime()
  2. Bugzilla 19526: make std.typecons.RefCounted work in betterC

Druntime bugs

  1. Bugzilla 11393: [GC] GC realloc and free don't ignore interior pointers
  2. Bugzilla 11446: [GC] GC realloc doesn't ignore non-GC owned pointers
  3. Bugzilla 12843: Unit tests fail when GC is compiled with SENTINEL
  4. Bugzilla 15393: Debug versions in GC code doesn't compile.
  5. Bugzilla 17431: GCBits should be @nogc to prevent deadlocks
  6. Bugzilla 19281: GC mishandles allocations >= 4GB
  7. Bugzilla 19522: [GC] GC.query/addrOf/sizeOf fail for freed memory
  8. Bugzilla 19562: core.internal.hash.hashOf array of pointers or delegates should be @safe
  9. Bugzilla 19568: hashOf should not unnecessarily call a struct's fields' postblits & dtors in CTFE
  10. Bugzilla 19571: Incorrect definition of DTM_FIRST in core.sys.windows.commctrl
  11. Bugzilla 19582: Make core.internal.convert.toUbyte in CTFE for arrays work with reference type elements and not call postblits/dtors
  12. Bugzilla 19593: dstrcmp with -profile causes stack overflow

Druntime enhancements

  1. Bugzilla 16377: Make --DRT GC profile information available outside of GC destruction
  2. Bugzilla 19128: argument to alloca may be too large
  3. Bugzilla 19455: GC wastes too much memory
  4. Bugzilla 19524: Make core.checkedint work in betterC

dlang.org bugs

  1. Bugzilla 19592: Rule for IdentifierList is wrong

Contributors to this release (50)

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

previous version: 2.084.0