mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

* druntime: Restrict some `pragma(inline, false)` kludges to DMD only
They appear related to DMD's inlining at the AST level; LDC at least
doesn't need them, so let the optimizer decide for non-DMD backends.
* Fix little C++ header regression
* Expose VarArg.KRvariadic to C++ headers
* Revert "Deprecate alias this for classes v2 (#14812)" (#15326)
This reverts commit af7817b4ae
.
* Add changelog for catch qualifier deprecation & update release no
---------
Co-authored-by: Martin Kinkelin <noone@nowhere.com>
Co-authored-by: Walter Bright <WalterBright@users.noreply.github.com>
Co-authored-by: Nick Treleaven <ntrel002@gmail.com>
27 lines
547 B
D
27 lines
547 B
D
// https://issues.dlang.org/show_bug.cgi?id=21039
|
|
|
|
class Inner {}
|
|
|
|
class Outer {
|
|
Inner inner;
|
|
alias inner this;
|
|
this(Inner i) { inner = i; }
|
|
}
|
|
|
|
void main() {
|
|
auto inner = new Inner;
|
|
auto outer = new Outer(new Inner);
|
|
|
|
// implicit cast goes through 'alias this'
|
|
|
|
Inner inner1 = outer; // Already does it
|
|
assert(inner1);
|
|
|
|
Inner[] inners = [inner, outer]; // Fixed
|
|
|
|
assert(inners[0], "first element is null");
|
|
assert(inners[1], "second element is null");
|
|
|
|
Inner inner2 = 1 ? outer : inner; // Fixed
|
|
assert(inner2);
|
|
}
|