Changes from the upstream D Language
OpenD forked off upstream D on January 1, 2024. Since then, some things have diverged. This page lists the differences.
Items are tagged [parser] if it had a parser change, [library] if a library change, and [experimental] if it is still subject to further major change at this time.
Additions
- [parser] Interpolated expression sequences added
- 0o777 octal literals added
- `version(D_OpenD)` is defined to identify the forked compiler
- `__traits(docComment, symbol)` is added to get the ddoc comment attached to a symbol
- [experimental] You can name unittests with `unittest "your name" { ... }`
- opUnaryRight, enables overriding the default behavior for post increment and post decrement
- [library] Atomic!T, an atomic type similar to what is provided with std::atomic in C++
- [parser] [experimental] You can name unittests with `unittest "your name" { ... }`
- [experimental] `opImplicitCast` added, which allows implicit conversions on function parameter passing or direct assignments to arbitrary types.
- `@implicit this()` constructors added, which allows implicit construction when passing arguments to functions.
- [parser] `private(this)` added for class-level private
- `-unittest=x` can take module patterns
Changes
- If a module is imported, it must have a module declaration at the top of the file, and it must match the import name.
- Files with invalid identifier chars might be modified to make a working anonymous name if and only if they are a top-level module, not imported by other things
- Bug fix for extern(C++) multiple inheritance merged (possibly regression causing but passes all tests so far
- `-preview=bitfields` is not supported. C style bitfields are a mistake to copy into D. You can still use them with C code (including with the importC feature).
Packaging
- The dmd, druntime, phobos, and ldc repos are all merged to reduce duplicated work.
- dub, reggae, and rdmd are not packaged with OpenD. If you depend on them, the upstream versions should work if you use the `--compiler` option to them.
Things upstream added after OpenD
None yet, but interpolated expression sequences coming soon to them too.