Bug 21347 – std.functional.adjoin should work in BetterC
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-10-29T02:10:44Z
Last change time
2020-10-29T03:45:21Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus
Comments
Comment #0 by snarwin+bugzilla — 2020-10-29T02:10:44Z
Example program:
---
extern(C) int main()
{
import std.functional: adjoin;
alias f = (int n) => n + 1;
alias g = (int n) => n + 2;
alias h = (int n) => n + 3;
alias i = (int n) => n + 4;
auto result = adjoin!(f, g, h, i)(0);
assert(result[0] == 1);
assert(result[1] == 2);
assert(result[2] == 3);
assert(result[3] == 4);
return 0;
}
---
Compiler output:
---
$ dmd -betterC bug.d
/usr/include/dmd/phobos/std/array.d(3243): Error: TypeInfo cannot be used with -betterC
$ dmd --version
DMD64 D Compiler v2.094.0
---
Note that due to details of the current implementation, only calls to adjoin with 4 or more template arguments are affected as of Phobos 2.094.0.
Comment #1 by dlang-bot — 2020-10-29T03:01:57Z
@pbackus created dlang/phobos pull request #7686 "Fix issue 21347 - std.functional.adjoin should work in BetterC" fixing this issue:
- Fix issue 21347 - std.functional.adjoin should work in BetterC
https://github.com/dlang/phobos/pull/7686
Comment #2 by dlang-bot — 2020-10-29T03:45:21Z
dlang/phobos pull request #7686 "Fix issue 21347 - std.functional.adjoin should work in BetterC" was merged into master:
- 8719a5fb9e3f455bff29a7aba0cb9aad5ae50b57 by Paul Backus:
Fix issue 21347 - std.functional.adjoin should work in BetterC
https://github.com/dlang/phobos/pull/7686