import std.meta;
struct Foo
{
int x;
}
mixin template Foo2()
{
int x;
}
struct S
{
Foo foo;
alias foos = AliasSeq!(foo);
mixin Foo2!() foo2;
alias foo2s = AliasSeq!(foo2);
}
void main()
{
S s;
auto x = s.foos[0].x; // ok
auto x2 = s.foo2s[0].x; // fail
}
a.d(26): Error: `this` is only defined in non-static member functions, not `main`
a.d(26): Error: accessing non-static variable `x` requires an instance of `S`
Comment #1 by robert.schadek — 2024-12-13T19:32:25Z