Change Log: 2.078.0 (upcoming)
Download D nightlies
To be released
Compiler changes
Library changes
List of all upcoming bug fixes and enhancements.
Compiler changes
- 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.
Library changes
- 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]));
- 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]));
- 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]]
- 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
- Bugzilla 17246: [REG2.053] Extra destructor call.
- Bugzilla 17915: [REG 2.073] core.exception.AssertError@ddmd/optimize.d(614): Assertion failure
- Bugzilla 17955: compiler segfault in DsymbolSemanticVisitor::visit(UnittestDeclaration*)
DMD Compiler bugs
- Bugzilla 5332: Undefined reference to zero length array
- Bugzilla 16649: Header gen skips parens
- Bugzilla 16997: Integral promotion rules not being followed for unary + - ~ expressions
- Bugzilla 17842: [scope] array append allows for escaping references
- Bugzilla 17853: Switch statement without braces only works with one case
- Bugzilla 17900: FreeBSD 10.3 runnable/cpp_abi_tests.d(94): Assertion failure (test suite)
- Bugzilla 17908: Can't alias an overload set with disabled function
- Bugzilla 17927: [scope] scope inout parameter value can be escaped via return
- Bugzilla 17940: bool function parameters loaded from struct sometimes miscompiled with -O
- Bugzilla 17944: MSCOFF: debug info not compatible with LLVMs LLD
- Bugzilla 17947: C++ std::pair::swap mangled incorrectly
DMD Compiler enhancements
- Bugzilla 17256: Inconsistent output between json and ddoc
- Bugzilla 17878: Add __traits(isFuture, ...)
Phobos bugs
- Bugzilla 2447: There's no disconnectall for std.signals
- Bugzilla 6895: std.traits.isCovariantWith doesn't work for function, function pointer and delegate
- Bugzilla 10395: [std.stdio] Closing a popened File with unread output throws an exception
- Bugzilla 16542: makeArray not usable with const initializer
- Bugzilla 17730: [scope][dip1000] std.algorithm.move escapes scope variable in @safe code
- Bugzilla 17901: FreeBSD 10.3: AssertError@std/experimental/allocator/building_blocks/region.d(652)
Phobos enhancements
- Bugzilla 1998: std.bitarray should have setAll / opSliceAssign(bool) etc
- Bugzilla 4717: std.bitmanip.BitArray changes
- Bugzilla 4763: std.stdio.File.open() : more efficient implementation
- Bugzilla 6244: Add powmod / modpow function to std.math
- Bugzilla 9362: Add a method to remove one item to std.container.SList
- Bugzilla 13532: std.regex performance (enums; regex vs ctRegex)
- Bugzilla 17905: byCodeUnit should allow access to underlying range
- Bugzilla 17952: std.range.transposed save is invalid
Druntime bugs
- Bugzilla 17851: htonl already defined in phobos64.lib
Tools bugs
- Bugzilla 7997: Optlink issues 'Index Range' error with static zero length array