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.078.0 (upcoming)

previous version: 2.077.0

Download D nightlies
To be released


List of all upcoming bug fixes and enhancements.

Compiler changes

  1. fix Issue 16997 - Integral promotion rules not being followed for unary + - ~ operators

    To follow the C integral promotion rules, types are promoted to int before the unary + - or ~ operators are applied. Existing D does not do this.

    This is corrected when one of the following command line switches are used:

    -transition=intpromote -transition=16997

    It affects operands of type byte, ubyte, short, ushort, char, and wchar. The operands are promoted to int before the operator is applied. The result type will now be int.

    The values computed will be different for some values of the operands:

    * All values of - and ~ applied to ubyte, ushort, char, and dchar operands will change.

    * The values of -byte(-128) and -short(-32768) will change.

    If one of the '-transition=' switches is not specified, and warnings are turned on, a warning will be emitted for these operations. To turn off the warning and work as desired with or without the '-transition=' switch:

    Option 1:

    Rewrite op b as op int(b) to use correct, i.e. C-like, behavior.

    Option 2:

    Rewrite op b as typeof(b)(op int(b)) to preserve the old behavior.

    Eventually, the warning will become a deprecation, then an error, and then the C-like behavior will become the default.

  2. Added RAII and try-finally support for -betterC mode.

    This also means that scope(exit) statements will also work, because they are internally lowered to try-finally statements.

    This does not mean that exceptions are supported. Throwing, catching, and stack frame unwinding is not supported, as that requires support from Phobos.

    It means that, for RAII, when variables go out of lexical scope their destructors get run. When try blocks from try-finally statements exit, the code in the finally block is run.

Library changes

  1. std.container.dlist supports linearRemoveElement

    linearRemoveElement removes the first occurence of an element from the dlist

    import std.container : Dlist;
    import std.algorithm.comparison : equal;
    
    auto a = DList!int(-1, 1, 2, 1, 3, 4);
    a.linearRemoveElement(1);
    assert(equal(a[], [-1, 2, 1, 3, 4]));
    
  2. std.container.slist supports linearRemoveElement

    linearRemoveElement removes the first occurence of an element from the slist

    import std.container : Slist;
    import std.algorithm.comparison : equal;
    
    auto a = SList!int(-1, 1, 2, 1, 3, 4);
    a.linearRemoveElement(1);
    assert(equal(a[], [-1, 2, 1, 3, 4]));
    
  3. Deprecate save for std.range.package.Transposed

    Transposed is incorrectly marked as a forward range. Its popFront primitive cannot be used without affecting any other copies made with save. save will be removed from Transposed in November 2018.

    https://issues.dlang.org/show_bug.cgi?id=17952

    auto x = [[1,2,3],[4,5,6]].transposed;
    auto y = x.save;
    y.popFront;
    assert(x.equal([[1,4],[2,5],[3,6]])); // FAILS, x is really [[2,5],[3,6]]
    
  4. std.typecons.Ternary.opBinary supports bool operands

    Now std.range.Ternary can be used in bitwise operations with bool

    import std.typecons : Ternary;
    
    Ternary a = Ternary(true);
    assert(a == Ternary.yes);
    assert((a & false) == Ternary.no);
    assert((a | false) == Ternary.yes);
    assert((a ^ true) == Ternary.no);
    assert((a ^ false) == Ternary.yes);
    

List of all bug fixes and enhancements in D 2.078.0 (upcoming):

DMD Compiler regressions

  1. Bugzilla 17246: [REG2.053] Extra destructor call.
  2. Bugzilla 17915: [REG 2.073] core.exception.AssertError@ddmd/optimize.d(614): Assertion failure
  3. Bugzilla 17955: compiler segfault in DsymbolSemanticVisitor::visit(UnittestDeclaration*)

DMD Compiler bugs

  1. Bugzilla 5332: Undefined reference to zero length array
  2. Bugzilla 10310: VRP for bitwise &|^ does not always produce the tightest bounds.
  3. Bugzilla 16649: Header gen skips parens
  4. Bugzilla 16997: Integral promotion rules not being followed for unary + - ~ expressions
  5. Bugzilla 17096: many traits accept an invalid parameter count without error
  6. Bugzilla 17167: dmd fails to write to file or create directory with more than 248 characters in the path
  7. Bugzilla 17382: void main(){}pragma(msg,main()); crashes DMD
  8. Bugzilla 17586: Overriding a deprecated base class function gives no warning
  9. Bugzilla 17842: [scope] array append allows for escaping references
  10. Bugzilla 17853: Switch statement without braces only works with one case
  11. Bugzilla 17900: FreeBSD 10.3 runnable/cpp_abi_tests.d(94): Assertion failure (test suite)
  12. Bugzilla 17908: Can't alias an overload set with disabled function
  13. Bugzilla 17927: [scope] scope inout parameter value can be escaped via return
  14. Bugzilla 17934: [scope] scopeness entrypoint for unique/ref-counted missing
  15. Bugzilla 17935: [scope] auto-generated destructor not scope aware
  16. Bugzilla 17940: bool function parameters loaded from struct sometimes miscompiled with -O
  17. Bugzilla 17944: MSCOFF: debug info not compatible with LLVMs LLD
  18. Bugzilla 17947: C++ std::pair::swap mangled incorrectly
  19. Bugzilla 17976: core.exception.AssertError@ddmd/dsymbolsem.d(1624)

DMD Compiler enhancements

  1. Bugzilla 4946: Not good error message with wrongly positioned 'const'
  2. Bugzilla 17256: Inconsistent output between json and ddoc
  3. Bugzilla 17878: Add __traits(isFuture, ...)

Phobos regressions

  1. Bugzilla 17962: dirEntries now truncates Unicode file names
  2. Bugzilla 17986: Erratic failure with std/experimental/allocator/common.d(445): unittest failure

Phobos bugs

  1. Bugzilla 2447: There's no disconnectall for std.signals
  2. Bugzilla 6820: etc.c.curl missing const
  3. Bugzilla 6895: std.traits.isCovariantWith doesn't work for function, function pointer and delegate
  4. Bugzilla 9661: LockingTextWriter should increment file handle reference count
  5. Bugzilla 10395: [std.stdio] Closing a popened File with unread output throws an exception
  6. Bugzilla 12064: std.typecons.wrap doesn't handle NVI
  7. Bugzilla 15140: std.experimental.allocator.building_blocks.free_list.FreeList leaks memory
  8. Bugzilla 15637: Region allocator assert failure when expanding the last allocation
  9. Bugzilla 16253: BitmappedBlock allocator not working with chooseAtRuntime
  10. Bugzilla 16542: makeArray not usable with const initializer
  11. Bugzilla 17467: BitArray are broken with <<= 64
  12. Bugzilla 17730: [scope][dip1000] std.algorithm.move escapes scope variable in @safe code
  13. Bugzilla 17901: FreeBSD 10.3: AssertError@std/experimental/allocator/building_blocks/region.d(652)

Phobos enhancements

  1. Bugzilla 1998: std.bitarray should have setAll / opSliceAssign(bool) etc
  2. Bugzilla 4717: std.bitmanip.BitArray changes
  3. Bugzilla 4763: std.stdio.File.open() : more efficient implementation
  4. Bugzilla 6244: Add powmod / modpow function to std.math
  5. Bugzilla 9362: Add a method to remove one item to std.container.SList
  6. Bugzilla 13532: std.regex performance (enums; regex vs ctRegex)
  7. Bugzilla 16398: experimental allocators, add aligned reallocation for Posix
  8. Bugzilla 17742: std.range.transposed does not have opIndex
  9. Bugzilla 17905: byCodeUnit should allow access to underlying range
  10. Bugzilla 17919: std.container.Array could use pureMalloc
  11. Bugzilla 17952: std.range.transposed save is invalid

Druntime bugs

  1. Bugzilla 17108: Associative array byKeyValue is unsafe
  2. Bugzilla 17851: htonl already defined in phobos64.lib

Tools bugs

  1. Bugzilla 7997: Optlink issues 'Index Range' error with static zero length array
previous version: 2.077.0