Bug 17803 – std.typecons.Tuple: opAssign should return ref Tuple
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2017-09-04T05:57:51Z
Last change time
2017-10-16T09:57:48Z
Keywords
pull, trivial
Assigned to
No Owner
Creator
Simen Kjaeraas
Comments
Comment #0 by simen.kjaras — 2017-09-04T05:57:51Z
As pointed out in issue 8494, this kind of code doesn't compile:
Tuple!int a;
return a = tuple(3);
The fix is two lines in std.typecons, and is fixed in this PR: https://github.com/dlang/phobos/pull/5713.
Comment #1 by simen.kjaras — 2017-09-07T06:25:16Z
Apparently I wasn't paying attention when filing this. The above code should be:
Tuple!int foo() {
Tuple!int a;
return a = tuple(3);
}
Comment #2 by github-bugzilla — 2017-09-07T07:17:26Z