Skip to content

Commit 652a09c

Browse files
committed
Fix deprecation warnings in newer compilers
1 parent 1d22c8c commit 652a09c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/expected.d

+6-6
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ struct Expected(T, E = string, Hook = Abort)
718718
void checked(bool ch) { assert(storage); storage.checked = ch; }
719719
}
720720

721-
ref inout(E) getError()() inout
721+
auto ref inout(E) getError()() inout
722722
{
723723
assert(storage);
724724
static if (__VERSION__ < 2078) // workaround - see: https://issues.dlang.org/show_bug.cgi?id=15094
@@ -736,7 +736,7 @@ struct Expected(T, E = string, Hook = Abort)
736736

737737
static if (!is(T == void))
738738
{
739-
ref inout(T) getValue()() inout
739+
auto ref inout(T) getValue()() inout
740740
{
741741
assert(storage);
742742
static if (__VERSION__ < 2078) // workaround - see: https://issues.dlang.org/show_bug.cgi?id=15094
@@ -760,15 +760,15 @@ struct Expected(T, E = string, Hook = Abort)
760760
State state = State.empty;
761761
static if (isChecked!Hook) bool checked = false;
762762

763-
ref inout(E) getError()() inout
763+
auto ref inout(E) getError()() inout
764764
{
765765
static if (Types.length == 1) return __traits(getMember, storage, "values")[0];
766766
else return __traits(getMember, storage, "values")[1];
767767
}
768768

769769
static if (!is(T == void))
770770
{
771-
ref inout(T) getValue()() inout
771+
auto ref inout(T) getValue()() inout
772772
{
773773
return __traits(getMember, storage, "values")[0];
774774
}
@@ -1531,7 +1531,7 @@ auto ref E expectErr(EX : Expected!(T, E, H), T, E, H)(auto ref EX res, lazy str
15311531
{
15321532
//TODO: hook for customization
15331533

1534-
if (res.hasError) return res.error;
1534+
if (res.hasError) return forwardError!res;
15351535

15361536
version (D_BetterC) assert(0, msg);
15371537
else
@@ -1548,7 +1548,7 @@ auto ref E expectErr(EX : Expected!(T, E, H), T, E, H)(auto ref EX res, lazy str
15481548
/// ditto
15491549
auto ref E expectErr(alias handler, EX : Expected!(T, E, H), T, E, H)(auto ref EX res)
15501550
{
1551-
if (res.hasError) return res.error;
1551+
if (res.hasError) return forwardError!res;
15521552

15531553
static if (!is(typeof(handler(forwardError!res)) == noreturn) && !is(typeof(handler(T.init)) == void))
15541554
{

0 commit comments

Comments
 (0)