```dptr.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 reports:

```
immutable(void function(R))
dptr.d(14): Error: expression `& foo` is not a valid template value argument
```

If I comment out line 17 the code compiles. I want to put the explicitly instantiated function template into an immutable AA. How can that be phrased such that dmd compiles it?

Reply via email to