D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18101 - allow Tuple for BetterC
Summary: allow Tuple for BetterC
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: betterC
Depends on:
Blocks:
 
Reported: 2017-12-18 14:26 UTC by changlon
Modified: 2020-01-28 01:23 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description changlon 2017-12-18 14:26:48 UTC
=============== code ===============
import std.typecons : Tuple;

alias BOMSeq = Tuple!(int, "schema");

extern(C) int main(){
        return 0;
}
=========================

../src/phobos/std/range/primitives.d(405): Error: static assert  "Cannot put a const(char)[] into a Appender!string."
../../src/phobos/std/format.d(1172):        instantiated from here: put!(Appender!string, const(char)[])
./../src/phobos/std/format.d(473):        instantiated from here: writeUpToNextSpec!(Appender!string)
../../src/phobos/std/format.d(5831):        instantiated from here: formattedWrite!(Appender!string, char, ulong, ulong)
../../src/phobos/std/typecons.d(542):        instantiated from here: format!(char, ulong, ulong)
test.d(4):        instantiated from here: Tuple!(int, "schema")
Comment 1 Seb 2017-12-21 13:46:43 UTC
The error has been fixed in

I opened a PR to add a betterC testsuite to Phobos https://github.com/dlang/phobos/pull/5952, but it still doesn't look like it can work.
Comment 2 moonlightsentinel 2020-01-28 01:23:44 UTC
Works for current HEAD