-
-
Notifications
You must be signed in to change notification settings - Fork 745
findSplit: return named tuples instead of an anonymous tuple #5968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
182a288 to
9a45368
Compare
|
Note that |
std/algorithm/searching.d
Outdated
|
|
||
| @safe unittest | ||
| { | ||
| import std.typecons : tuple; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary, it's imported at the top
| $(REF findSplit, std,algorithm,searching), | ||
| $(REF findSplitBefore, std,algorithm,searching), and | ||
| $(REF findSplitAfter, std,algorithm,searching) | ||
| will return a named tuple tuple instead of an anonymous tuple: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "tuple tuple" > "tuple"
9a45368 to
943f229
Compare
- `std.algorithm.searching.findSplit` - `std.algorithm.searching.findSplitBefore` - `std.algorithm.searching.findSplitAfter` will return a named tuple tuple instead of an anonymous tuple:
std/typecons.d(648): Error: reinterpreting cast from inout(string)* to inout(Tuple!(string, string, string))* is not supported in CTFE
std/traits.d(566): called from here: findSplit(s, "(").asTuple._Tuple_super()
std/traits.d(568): called from here: adjustIdent("std")
std/traits.d(556): Error: template instance std.traits.fqnSym!(std) error instantiating
std/traits.d(556): instantiated from here: fqnSym!(traits)
std/traits.d(478): instantiated from here: fqnSym!(fullyQualifiedName)
std/traits.d(484): instantiated from here: fullyQualifiedName!(fullyQualifiedName)
std/traits.d(484): while evaluating: static assert(fullyQualifiedName!(fullyQualifiedName) == "std.traits.fullyQualifiedName")
943f229 to
8becc70
Compare
|
Let's move forward with this. |
|
This broke DStep [1]. It's the same error as the second commit 8becc70 in this PR fixes. But according to the documentation of [1] https://travis-ci.org/jacob-carlborg/dstep/jobs/333759750 |
|
I can we please revert this. It broke Phobos and DStep, then it's likely that it will break other projects as well. |
Split-up from #5962
Motivation: Named tuples are a lot better to read.
There has been a precedent for this, see #5436