December 15, 2023 [Issue 24282] Error in the code is not detected by the compiler and only fails at the linking stage | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24282 Dennis <dkorpel@live.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dkorpel@live.nl --- Comment #1 from Dennis <dkorpel@live.nl> --- Reduced to remove imports: ```D template map(fun...) { auto map(Range)(Range r) { alias RE = ElementType!Range; alias _fun = unaryFun!fun; assert(!is(typeof(_fun(RE.init)) )); MapResult!(_fun, Range)(r); } } struct MapResult(alias fun, Range) { Range input; this(Range range) { } void front() { fun(input.front); } } template unaryFun(alias fun) { alias unaryFun = fun; } template ElementType(R) { static if (is(typeof(R.init.front) T)) alias ElementType = T; } string front(string[] s) { return ""; } int dummyhash(string s) { return 0; } void main() { auto input = ["a", "b"]; input.map!(s => s.map!dummyhash); } ``` -- |
January 05, 2024 [Issue 24282] Error in the code is not detected by the compiler and only fails at the linking stage | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24282 RazvanN <razvan.nitu1305@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |razvan.nitu1305@gmail.com Resolution|--- |DUPLICATE --- Comment #2 from RazvanN <razvan.nitu1305@gmail.com> --- *** This issue has been marked as a duplicate of issue 15459 *** -- |
Copyright © 1999-2021 by the D Language Foundation