[Issue 22641] New: dmd reports wrong line number (Error: expression ... is not a valid template value argument)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jan 1 13:14:09 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22641
Issue ID: 22641
Summary: dmd reports wrong line number (Error: expression ...
is not a valid template value argument)
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: kdevel at vogtner.de
maybe related: Issue 21960 - Error in enum implicit conversion to string
reports wrong line number.
Code from forum post [1]
```d.d
class R {
}
void foo (R r)
{
}
alias fn = void function (R);
void lyr (fn F) (R r)
{
}
immutable fn foo_ptr = &foo; // line 14
pragma (msg, typeof (foo_ptr));
auto ptr = lyr!(foo_ptr); // line 17
```
$ dmd -c d.d
immutable(void function(R))
d.d(14): Error: expression `& foo` is not a valid template value argument
expected: Error reported for line number 17.
[1] https://forum.dlang.org/thread/tjafunqytzjtupczizgt@forum.dlang.org
--
More information about the Digitalmars-d-bugs
mailing list