Testcase:
```
struct BaseBlock
{
void baseFoo()
{
}
}
template someMixin(alias Func)
{
}
struct BlockHandle(T)
{
T* block;
void foo()
{
block.baseFoo;
}
mixin someMixin!((BlockHandle!T self) {
self.foo;
});
}
struct ChildBlock
{
version (BUG)
{
alias Handle = BlockHandle!(typeof(this));
BaseBlock base;
alias base this;
}
else
{
BaseBlock base;
alias base this;
alias Handle = BlockHandle!(typeof(this));
}
}
```
Compilation without any flags succeeds.
But compilation with -version=BUG resuls in the error:
aliasbug.d(18): Error: no property `baseFoo` for type `aliasbug.ChildBlock*
Apparently the `alias this` is ignored during the evaluation of `alias Handle = BlockHandle!(typeof(this));`, if the `alias this` is defined after the `alias Handle = ...`.
The testcase succeeds with/without -version=BUG for dlang 2.077. (The bug was detected as a regression between 2.093 and 2.097, but after dustmiting to the testcase above it fails also with 2.093.)
Comment #1 by robert.schadek — 2024-12-13T19:20:01Z