@@ -718,7 +718,7 @@ struct Expected(T, E = string, Hook = Abort)
718
718
void checked (bool ch) { assert (storage); storage.checked = ch; }
719
719
}
720
720
721
- ref inout (E) getError ()() inout
721
+ auto ref inout (E) getError ()() inout
722
722
{
723
723
assert (storage);
724
724
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)
736
736
737
737
static if (! is (T == void ))
738
738
{
739
- ref inout (T) getValue ()() inout
739
+ auto ref inout (T) getValue ()() inout
740
740
{
741
741
assert (storage);
742
742
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)
760
760
State state = State.empty;
761
761
static if (isChecked! Hook) bool checked = false ;
762
762
763
- ref inout (E) getError ()() inout
763
+ auto ref inout (E) getError ()() inout
764
764
{
765
765
static if (Types.length == 1 ) return __traits(getMember, storage, " values" )[0 ];
766
766
else return __traits(getMember, storage, " values" )[1 ];
767
767
}
768
768
769
769
static if (! is (T == void ))
770
770
{
771
- ref inout (T) getValue ()() inout
771
+ auto ref inout (T) getValue ()() inout
772
772
{
773
773
return __traits (getMember, storage, " values" )[0 ];
774
774
}
@@ -1531,7 +1531,7 @@ auto ref E expectErr(EX : Expected!(T, E, H), T, E, H)(auto ref EX res, lazy str
1531
1531
{
1532
1532
// TODO: hook for customization
1533
1533
1534
- if (res.hasError) return res.error ;
1534
+ if (res.hasError) return forwardError ! res;
1535
1535
1536
1536
version (D_BetterC ) assert (0 , msg);
1537
1537
else
@@ -1548,7 +1548,7 @@ auto ref E expectErr(EX : Expected!(T, E, H), T, E, H)(auto ref EX res, lazy str
1548
1548
// / ditto
1549
1549
auto ref E expectErr (alias handler, EX : Expected! (T, E, H), T, E, H)(auto ref EX res)
1550
1550
{
1551
- if (res.hasError) return res.error ;
1551
+ if (res.hasError) return forwardError ! res;
1552
1552
1553
1553
static if (! is (typeof (handler(forwardError! res)) == noreturn) && ! is (typeof (handler(T.init)) == void ))
1554
1554
{
0 commit comments