Showing with 8 additions and 1 deletion.
  1. +8 −1 std/typecons.d
9 changes: 8 additions & 1 deletion std/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ private mixin template RebindableCommon(T, U, alias This)
opAssign(initializer);
}

@property ref inout(T) get() inout
@property inout(T) get() inout
{
return original;
}
Expand Down Expand Up @@ -1657,6 +1657,13 @@ unittest
a = new Widget;
}

unittest // issue 16054
{
Rebindable!(immutable Object) r;
static assert(__traits(compiles, r.get()));
static assert(!__traits(compiles, &r.get()));
}

/**
Convenience function for creating a $(D Rebindable) using automatic type
inference.
Expand Down