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 local clone.

Change Log: 2.021

previous version: 2.020 – next version: 2.022all versions

Download D 2.021
released Nov 25, 2008

New/Changed Features

  • Added -safe switch and module(system) Identifier; syntax.
  • Added range support to foreach statement.
  • scope parameter storage class means the parameter will not 'escape' the scope of the function invocation. Using this for delegate parameters will prevent some closure allocations by the calling function.
  • The lazy storage class now implies scope so that lazy arguments won't trigger a heap allocated closure.
  • The 'this' parameter to struct member functions is now a reference type, rather than a pointer. This breaks existing code.
  • More changes to druntime:
    from to
    OutOfMemoryException OutOfMemoryError
    SwitchException SwitchError
    HiddenFuncException HiddenFuncError
    ArrayBoundsException RangeError
    AssertException AssertError
    FinalizeException FinalizeError
    onArrayBoundsError onRangeError
    stdc.* core.stdc.*
    sys.* core.sys.*
  • Added core.runtime.loadLibrary() as an experimental feature for loading dynamic libraries (Win32 only at the moment).
  • Added core.runtime.unloadLibrary() as an experimental feature for unloading dynamic libraries previously loaded by loadLibrary().
  • core.thread.sleep() accepts a long integer specifying the sleep interval in 100 nanosecond intervals (the previous release notes said this was a float, IIRC).
  • It is no longer necessary to link in druntime separately, it is inserted into libphobos2.a.

Bugs Fixed

  • Bugzilla 313: Fully qualified names bypass private imports
  • Bugzilla 920: SPEC: Auto classes referenced where scope should be used
  • Bugzilla 929: Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang
  • Bugzilla 1372: Compiler accepts pragma(msg,)
  • Bugzilla 1610: Enum.stringof is int, not the name of the enum
  • Bugzilla 1663: pragma(lib, "") don't work on linux
  • Bugzilla 1797: Documentation comments - ///
  • Bugzilla 2428: Accessing item in enum'd array produced compiler error
  • Bugzilla 2429: std.stream.File incorrect flag parsing and sharing mode
  • Bugzilla 2431: Internal error: ../ztc/cgcod.c 1031 when using -O
  • Bugzilla 2470: Cannot build libraries from other libraries
  • unittest functions now always use D linkage
previous version: 2.020 – next version: 2.022all versions