Bug 18824 – [REG 2.080] Tuple's opBinaryRight takes precedence over appending a tuple to an array of tuples

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-05-04T09:42:39Z
Last change time
2018-12-24T19:21:54Z
Assigned to
Eduard Staniloiu
Creator
Mitu

Comments

Comment #0 by the.mail.of.mi2 — 2018-05-04T09:42:39Z
This code fails to compile: import std.stdio; import std.typecons; alias Type = Tuple!(int, string); void main() { Type[] arr; arr = arr ~ tuple(2, "s"); writeln(arr); } Message: onlineapp.d(8): Error: cannot implicitly convert expression tuple(2, "s").opBinaryRight(arr) of type Tuple!(Tuple!(int, string)[], int, string) to Tuple!(int, string)[] I can't see anything in changelog that could be related to this, thus I expect it's a regression.
Comment #1 by Marco.Leise — 2018-05-06T17:28:55Z
I think the component should be "Phobos". I met the same issue, but were coming from a ternary operator: enum foo() { import std.typecons; Tuple!(string, size_t)[] parts; return true ? parts ~ tuple("abc", size_t.max) : parts; } Message: test.d(4): Error: incompatible types for (tuple("abc", 18446744073709551615LU).opBinaryRight(parts)) : (parts): Tuple!(Tuple!(string, ulong)[], string, ulong) and Tuple!(string, ulong)[] The changelog entries are probably: Phobos enhancements 1. Bugzilla 4591: Concat of std.typecons.Tuples https://issues.dlang.org/show_bug.cgi?id=4591 […] 5. Bugzilla 14637: Array operations should work on tuples https://issues.dlang.org/show_bug.cgi?id=14637
Comment #2 by edi33416 — 2018-12-18T16:20:16Z
Comment #3 by github-bugzilla — 2018-12-24T19:21:54Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/36a9dfaaf225c749c6d5cf90a81656fcfe9d500f Fix Issue 18824 - [REG 2.080] Tuple's opBinaryRight takes precedence over appending a tuple to an array of tuples https://github.com/dlang/phobos/commit/b962752193b39ca68950876410785658cb2d9fa5 Merge pull request #6804 from edi33416/issue_18824 Fix Issue 18824 - [REG 2.080] Tuple's opBinaryRight takes precedence … merged-on-behalf-of: Sebastian Wilzbach <[email protected]>