Skip to content

Commit b73beab

Browse files
authored
Update expression.dd (#3720)
Change the example for "The use of `ref` declares that the return value is returned by reference" to actually show (and require) that the return value is by reference.
1 parent 62c8761 commit b73beab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/expression.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,8 +2240,8 @@ $(GNAME RefOrAutoRef):
22402240
{
22412241
int x;
22422242
auto dg = delegate ref int() { return x; };
2243-
x = 3;
2244-
assert(dg() == 3);
2243+
dg() = 3;
2244+
assert(x == 3);
22452245
}
22462246
---
22472247
)

0 commit comments

Comments
 (0)