Overriding of inherited class static methods?
monkyyy
crazymonkyyy at gmail.com
Thu Jul 23 21:07:32 UTC 2026
On Thursday, 23 July 2026 at 20:24:41 UTC, Richard (Rikki) Andrew
Cattermole wrote:
>
> However symbol lookup can handle this just fine,
my understanding of what op wants is this:
```d
import std;
interface base{
static int foo(int);
}
class A:base{
static int foo(int i)=>i+2;
}
class B:base{
static int foo(int i)=>i*2;
}
unittest{
base bar=new A();
auto f=&bar.foo;
f(3).writeln;
}
```
this doesn't link
maybe op was thinking of aa's redbook "policys" but runtime, idk
[insert an oo is bad rant here]
I think your "Linker list"s needs to be generalized to pseudo
compiletime appended list, because look its a "type to runtime
value lookup table" *again*, thats been some of my problems, its
your linker lists and if Im right about what op wants it could be
reframmed as an `int function(int)[TypeInfo]` issue
More information about the Digitalmars-d
mailing list