Change Log: 2.062
Download D 2.062
released Feb 18, 2013
Language Changes
- typeof() change:
 - alias syntax change:
 
As a result of fixing Bugzilla 6408, the usage of typeof() and indexing may require changes to user code:
template ElementTypeOf(T) { alias typeof(T[0]) ElementTypeOf; } void main() { // worked in 2.061 due to a bug static assert(is(ElementTypeOf!(int[]) == int)); }
The expression in typeof(T[0]) used to be wrongly interpreted as the element type of T, however in v2.062 it is interpreted as a static array of element T with length 0. To work around this the user can either use a trait from the standard library, or use the .init property of a type for arbitrary expressions:
import std.range; template ElementTypeOf(T) { // use T.init alias typeof(T.init[0]) ElementTypeOf; } void main() { // use std.range.ElementType static assert(is(ElementType!(int[]) == int)); // use custom template after fixing its code static assert(is(ElementTypeOf!(int[]) == int)); }
The newly introduced "alias foo = int" syntax is not usable with subtyping. This is to prevent confusion from a possible future syntax which would enable aliasing of super constructors. For now, the existing alias syntax can be used:
struct S { int x; // alias this = x; // error alias x this; }
In the upcoming release (v2.063) a new syntax will be introduced:
struct S { int x; alias this : x; // new feature in upcoming 2.063 }
List of all bug fixes and enhancements:
DMD Compiler regressions
- Bugzilla 9174: regression(2.057) ice(cast.c) with ternary operator and alias this
 - Bugzilla 9244: union containing pointers not allowed
 - Bugzilla 9258: opAssign with base class triggers "identity assignment operator overload" error
 - Bugzilla 9259: Passing an array of pointers to a typesafe vararg is broken
 - Bugzilla 9263: statement is not reachable when statement is reachable
 - Bugzilla 9266: Cannot define two Tuple objects.
 - Bugzilla 9268: [ice-on-invalid] void assignment in fail44.d no longer caught in frontend
 - Bugzilla 9273: DMD segfaults with templated ctors in implicit super call
 - Bugzilla 9276: regression(2.061): Forward reference error
 - Bugzilla 9278: ICE todt.c:692 when float containing struct is defined after use
 - Bugzilla 9309: Regression (2.061): -O -release generates wrong code
 - Bugzilla 9332: [REG][2.060 -> 02.061] struct constructor taking itself creates 'Warning: statement is not reachable'
 - Bugzilla 9377: Link-failure regression cause by fixing issue 8504
 - Bugzilla 9385: [Regression 2.057] null literal should be implicitly convertible to bool
 - Bugzilla 9387: Compiler switch -O changes behavior of correct code
 - Bugzilla 9399: ICE with nested function, template alias parameter, -inline, depending on order of source files
 - Bugzilla 9404: Nullable is unusable with 2.061
 - Bugzilla 9406: (Regression: 2.061) Stack overflow from a forward reference error
 - Bugzilla 9409: [2.062-alpha] Regression with $ inside of expression tuples
 - Bugzilla 9410: [Regression 2.061] Wrong selection for function overload
 - Bugzilla 9416: [REG][2.060 -> 02.061] DMD eagerly instantiates template parameter-less opAssign
 - Bugzilla 9420: [2.062alpha] Weird "(null)" output in error message
 - Bugzilla 9435: regression(head): forward reference error
 - Bugzilla 9436: enum cannot be forward referenced with cyclic imports and mixin
 - Bugzilla 9496: [REG 2.061 -> 2.062 alpha] "this[1 .. $]" passes wrong "this" to "opDollar"
 - Bugzilla 9514: "template instance … is not an alias"
 - Bugzilla 9525: [CTFE] Cannot convert &S to const(S*) at compile time
 
DMD Compiler bugs
- Bugzilla 1369: Unable to find 'this' in __traits(getMember)
 - Bugzilla 1730: Bogus error message calling a non-const struct method on a const struct reference
 - Bugzilla 1841: Closure detection doesn't work when variable is used in a nested function
 - Bugzilla 2452: Unimplemented method errors should show function overload
 - Bugzilla 3321: debug flags
 - Bugzilla 3466: Wrong JSON output for templated classes, structs, and interfaces
 - Bugzilla 4178: destructor missing in JSON output
 - Bugzilla 4269: Regression(2.031): invalid type accepted if evaluated while errors are gagged
 - Bugzilla 4477: JSON output for function definitions includes insufficient type information
 - Bugzilla 4478: JSON output omits import statements
 - Bugzilla 4540: Better error message for wrong switch type
 - Bugzilla 5168: String enums don't work with -g compiler switch
 - Bugzilla 5461: Invalid declaration for auto functions in .di files generated by DMD -H
 - Bugzilla 5933: Cannot retrieve the return type of an auto-return member function
 - Bugzilla 5978: ICE(mtype.c) when calling __traits(parent) on the child of an anonymous function.
 - Bugzilla 6057: Problem with defining enum in function
 - Bugzilla 6319: debug's relaxed purity does not apply to nested scopes
 - Bugzilla 6332: Auto-return function cannot be inferred as @safe
 - Bugzilla 6408: string[].init gives a wrong type
 - Bugzilla 6538: ICE(mangle.c) Invalid template constraints
 - Bugzilla 6552: Wrong fallthrough warning for CaseRange
 - Bugzilla 6652: foreach parameter with number range is always ref
 - Bugzilla 6708: immutable ref implicit cast to const ref
 - Bugzilla 6743: ICE(mars.c) attempting to compile an exe file
 - Bugzilla 6833: Floating point literals lose fractional part in headers
 - Bugzilla 6873: Multiple storage class is not allowed on template argument
 - Bugzilla 6902: Different "pure nothrow int()" types
 - Bugzilla 6905: ref acts as auto ref when return type is missing
 - Bugzilla 6962: Wrong Code With Scope Exit and Array Parameter, only with -O
 - Bugzilla 6963: pure/nothrow inference doesn't work for function pointers
 - Bugzilla 7152: Can't assign null to default argument
 - Bugzilla 7159: Forward reference when casting auto return method
 - Bugzilla 7252: ICE(template.c): 'global.errors' on line 4893 in file 'template.c'
 - Bugzilla 7408: traits compiles fails for built-in properties of template instances
 - Bugzilla 7420: Duplicate "cannot be read at compile time" error messages
 - Bugzilla 7585: functions in templates inferred as delegate
 - Bugzilla 7740: unicodeProperties cannot be read at compile time for ctRegex
 - Bugzilla 7950: Type tuples are incorrectly flattened in base type list of interface
 - Bugzilla 8053: Recursive alias this causes infinite loop
 - Bugzilla 8152: Linking C library causes Seg-fault
 - Bugzilla 8153: Warning about toHash signature is incorrect on x86_64
 - Bugzilla 8504: Template attribute inferrence doesn't work
 - Bugzilla 8583: [64 bit] AA ushort[dchar] byValue range is corrupted on x86_64
 - Bugzilla 8631: illegal overrides accepted
 - Bugzilla 8717: private and protected restrict member usage in same module
 - Bugzilla 8741: wrong code for struct member initialized using struct constructor
 - Bugzilla 8742: Anonymous nested class derived from another nested class makes DMD crash
 - Bugzilla 8763: struct initialization with empty variadic arguments tries to call constructor
 - Bugzilla 8783: ref foreach update of const fixed size arrays in constructor
 - Bugzilla 8787: Virtual not abstract methods in interfaces error message
 - Bugzilla 8832: Segfault when accessing range returned by function that has delegate referencing local variables
 - Bugzilla 8847: voldemort + inout confuses "is"
 - Bugzilla 8892: Wrong diagnostic for static array assignment
 - Bugzilla 8898: false positive dangling else warning
 - Bugzilla 8913: Wrong code in IfStatement condition Expression
 - Bugzilla 8922: __traits(parent, <imported package>) shows current module as a parent
 - Bugzilla 8969: is(T == __parameters) is undocumented
 - Bugzilla 8982: ICE(ctfeexpr.c) __parameters of an erroneous default parameter
 - Bugzilla 9018: __traits(compiles, ...) is true on second check for same incompilable code
 - Bugzilla 9083: mixin expression on template argument doesn't work
 - Bugzilla 9113: ICE(interpret.c): CTFE assignment to member of struct in union
 - Bugzilla 9178: UDA: getAttributes does not play well with tupleof
 - Bugzilla 9191: Unhelpful error message on failing override
 - Bugzilla 9195: Should not be able to index a pointer in safed
 - Bugzilla 9198: Vararg functions don't respect IFTI rules
 - Bugzilla 9200: Wrong SIMD code generated
 - Bugzilla 9208: [ICE](func.c line 1205) with auto return in recursive function
 - Bugzilla 9236: CTFE ice on switch + with(EnumType)
 - Bugzilla 9250: Wrong line number for error involving length of a static array
 - Bugzilla 9254: ICE on invalid foreach aggregate
 - Bugzilla 9264: [64bit] Wrong code with conversion from int parameter to float
 - Bugzilla 9284: DMD segfaults with templated ctors in constructor delegation
 - Bugzilla 9291: [ICE][REG] throwing undefined identifier with nothrow crashes dmd
 - Bugzilla 9293: enum struct with StructInitializer reports weird error
 - Bugzilla 9304: Unary minus operator doesn't work correctly with SIMD types.
 - Bugzilla 9305: Ugly Ddoc for default template lambda expressions
 - Bugzilla 9312: with statement error message is wrong
 - Bugzilla 9315: ICE (expression.c:4249, StructLiteralExp::getField) Tupleof of nested struct literal
 - Bugzilla 9320: optimizer should do copy propagation on structs, too
 - Bugzilla 9322: Internal error: ../ztc/cod1.c 3510 with SIMD on OSX 32
 - Bugzilla 9330: Cannot run dmd test suite with MSYS
 - Bugzilla 9338: Compiler segfaults if try to CTFE member function without valid 'this'
 - Bugzilla 9348: "tmpl!arg" syntax followed by "!is" or "!in"
 - Bugzilla 9350: std.algorithm.findAdjacent unreachable code warning with infinite ranges
 - Bugzilla 9357: Floating-point literal should always be printed with a period in diagnostic errors
 - Bugzilla 9358: Compiler creates duplicate switch cases after an error
 - Bugzilla 9368: Final switch on typedef'ed enum is not properly checked
 - Bugzilla 9369: DDoc hardcodes '&' -> '&' in code
 - Bugzilla 9374: 'super' should be accessible inside template constraint
 - Bugzilla 9398: Wrong diagnostic for ternary operator type mismatch
 - Bugzilla 9418: Segmentation fault using only datetime and stdio.
 - Bugzilla 9438: Strange RefCounted stack overflow
 - Bugzilla 9442: typeid() doesn't work without this. for class fields
 - Bugzilla 9453: ice(symbol.c) with slice on temporary
 - Bugzilla 9458: ModExp generates invalid code against array operands
 - Bugzilla 9461: Ability to break typesystem with inout
 - Bugzilla 9479: _error_ in error message of type inference of a delegate literal
 - Bugzilla 9484: Syntax error in JSON output
 - Bugzilla 9510: core.bitop.bsr undefined
 
DMD Compiler enhancements
- Bugzilla 2630: ddoc should be able to document unittests
 - Bugzilla 3404: JSON output should retain original alias names
 - Bugzilla 4194: Attributes included in JSON output
 - Bugzilla 5529: std.system.endian for pure functions?
 - Bugzilla 5893: Allow simple aliases for operator overloading
 - Bugzilla 6171: rdmd: cache dependency file to improve startup time [patch]
 - Bugzilla 8105: Implement "in ref"
 - Bugzilla 8128: unittest blocks should be allowed in interfaces
 - Bugzilla 9389: ignore -Hd if -Hf is present
 - Bugzilla 9463: make @safe "non-escapable"
 
Phobos regressions
- Bugzilla 9355: [security] SSL certificate signature verification disabled in std.net.curl
 - Bugzilla 9444: Regression (2.059): shell doesn't throw on error.
 - Bugzilla 9457: isSorted(string) doesn't work
 - Bugzilla 9523: std.conv.to will no longer convert enums to themselves
 
Phobos bugs
- Bugzilla 5065: writefln("%f" of a Tuple prints a result
 - Bugzilla 5265: std.array.back does not work correctly for wchar-based arrays
 - Bugzilla 5726: boyerMooreFinder hangs when finding
 - Bugzilla 5763: traits.d BaseClassesTuple function incorrectly handles Object class argument
 - Bugzilla 5773: sort() and topN() fail on sliced/resized array of tuples
 - Bugzilla 6066: std.container: BinaryHeap interface is broken.
 - Bugzilla 6436: Refcounted initialization bug
 - Bugzilla 6635: std.conv.emplace: enforcement is too weak
 - Bugzilla 6668: Wrong "to" conversion stack trace
 - Bugzilla 7142: Wrong formatted write of boolean values
 - Bugzilla 7659: std.stdio.File.close() erases file.name
 - Bugzilla 7819: std.file.setTimes throws error on folders
 - Bugzilla 8078: receiveOnly should tell which type it expected and got on mismatch
 - Bugzilla 8314: randomSample primes with constant
 - Bugzilla 8326: std.string.format results in run-time exception
 - Bugzilla 8367: std.range.chain's template constraint is inadequate
 - Bugzilla 8368: std.algorithm.sort's template constraint is inadequate
 - Bugzilla 8567: isDynamicArrray!S == true for S with alias this to array
 - Bugzilla 8689: Variant opArithmetic does not attempt float conversion
 - Bugzilla 8694: std.zlib.(Un)Compress can cause an _onInvalidMemoryOperationError
 - Bugzilla 8837: BigInt needs better operator template constraints
 - Bugzilla 8890: std.algorithm.commonPrefix does not handle unicode correctly
 - Bugzilla 8920: iota should work with all integral types
 - Bugzilla 9005: std.concurrency.spawn should allow void delegate(Args) shared for new Tid
 - Bugzilla 9163: std.parallelism broken with extensive optimizations (gdc)
 - Bugzilla 9211: regex lookahead, (?=(\d\d\d)+\b) failed
 - Bugzilla 9288: Parameter(Identifier|DefaultValue)Tuple report pointless errors
 - Bugzilla 9299: std.algorithm.minPos of const(int)[]
 - Bugzilla 9317: ParameterStorageClassTuple reports errors for inout function
 - Bugzilla 9336: Writeln is unable to print address of shared variable
 
Phobos enhancements
- Bugzilla 4287: opOpAssign!("~=") for std.array.Appender
 - Bugzilla 4813: trait for getting at access modifiers
 - Bugzilla 5666: std.array.replace compile error (string and immutable string)
 - Bugzilla 6614: std.traits should have an isFinal template
 - Bugzilla 7896: Sequence slicing
 - Bugzilla 8143: Safe std.conv.to enum conversion
 - Bugzilla 9337: There's no Duration.max
 - Bugzilla 9339: std.random.uniform!Enum should return random enum member
 
Druntime bugs
- Bugzilla 4793: Runtime.loadLibrary cannot load dll using MBS paths.
 - Bugzilla 5375: Detection of cyclic module imports provides error findings on console, instead of exception msg
 - Bugzilla 8132: LPTSTR always aliases to LPSTR
 - Bugzilla 9373: Add deprecation message to all empty deprecation statements
 
Website regressions
- Bugzilla 9467: Operator Overloading anchors are broken
 - Bugzilla 9492: [2.052 beta] Stylesheet not found for off-line HTML docs
 
Website bugs
- Bugzilla 5513: Erroneous example in std.algorithm
 - Bugzilla 7304: Online docs incorrect with regards to covariant arrays
 - Bugzilla 7345: interfaceToC.html missing on left-hand side
 - Bugzilla 8302: Documentation of dirEntries in std.file is incomplete
 - Bugzilla 8574: [std.format] The flag ' ' works for floating numbers, not only for integers
 - Bugzilla 8619: Tuples article uses writefln instead of writeln
 - Bugzilla 9321: Dead link to HTML5 standard in language specification
 - Bugzilla 9394: ABI for static arrays is outdated
 - Bugzilla 9446: ".keys" missing from properties table at http://dlang.org/hash-map.html
 - Bugzilla 9503: [grammar] template declaration/instance must take one or more arguments?
 
Website enhancements
- Bugzilla 9302: Document extern properly