https://issues.dlang.org/show_bug.cgi?id=19809
Issue ID: 19809
Summary: `override` block affects passing lambda as argument
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
I'm having issues with the following code
```
mixin template Impl(M...)
{
int opCmp(Object o) { return 0; }
}
class C
{
override
{
mixin Impl!("x", "y", ((int x) => &x + 1));
}
}
```
This gives me the error:
Error: delegate `t.C.__lambda2` cannot override a non-virtual function
This should compile.
Contrasting, the following code compiles just fine
```
class B
{
void foo(int function(int) fp) {}
}
class C : B
{
override
{
void foo(int function(int) fp = (int x) => x) {}
}
}
```
--