[Issue 23404] CTFE evaluation is unecessary when passing function return type as aliased template argument
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Oct 14 16:26:33 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23404
--- Comment #2 from Luís Ferreira <contact at lsferreira.net> ---
(In reply to ag0aep6g from comment #1)
> You're not passing `foo`'s return *type* to `weird`. You're trying to pass
> its return *value*. For that, the function must go through CTFE.
>
> As far as I can see, there is no bug here. Closing as invalid.
Well I thought that this was possible:
```
void bar();
int foo()()
{
bar();
return 1;
}
void weird(alias func)() {}
void main()
{
alias func = foo();
}
```
But it fails too. To be clear, I'm not expecting it to be the return type but
the template instance, but there's nothing to be CTFEable here.
--
More information about the Digitalmars-d-bugs
mailing list