File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2478,7 +2478,7 @@ struct Slice(size_t _N, _Range)
24782478 +/
24792479 auto ref opIndexOpAssign (string op, T)(T value, size_t [N] _indexes... )
24802480 {
2481- mixin (` return _ptr[indexStride(_indexes)] ` ~ op ~ ` = value; ` );
2481+ return mixin (` _ptr[indexStride(_indexes)] ` ~ op ~ ` = value` );
24822482 }
24832483
24842484 static if (doUnittest)
@@ -2727,9 +2727,10 @@ struct Slice(size_t _N, _Range)
27272727 Increment `++` and Decrement `--` operators for a $(B fully defined index).
27282728 +/
27292729 auto ref opIndexUnary (string op)(size_t [N] _indexes... )
2730- if (op == ` ++` || op == ` --` )
2730+ // @@@workaround@@@ for Issue 16473
2731+ // if (op == `++` || op == `--`)
27312732 {
2732- mixin (` return ` ~ op ~ ` _ptr[indexStride(_indexes)]; ` );
2733+ return mixin (` ` ~ op ~ ` _ptr[indexStride(_indexes)]` );
27332734 }
27342735
27352736 static if (doUnittest)
@@ -2742,6 +2743,14 @@ struct Slice(size_t _N, _Range)
27422743 assert (a[1 , 2 ] == 1 );
27432744 }
27442745
2746+ // Issue 16473
2747+ static if (doUnittest)
2748+ unittest
2749+ {
2750+ auto sl = slice! double (2 , 5 );
2751+ auto d = - sl[0 , 1 ];
2752+ }
2753+
27452754 static if (doUnittest)
27462755 pure nothrow unittest
27472756 {
You can’t perform that action at this time.
0 commit comments