Reduced:

import std.stdio;

mixin template Foo() {
  string data = "default";
}

class Bar {
  string data;
  mixin Foo f;
}

void check_data(alias M, T)(T obj) {
  writeln(M.stringof);
  writeln(obj.data);
  writeln(obj.f.data);
}

void main() {
  Bar bar = new Bar;
  bar.data = "Bar";
  bar.f.data = "F";

  writeln(bar.data);
  writeln(bar.f.data);

  check_data!(Bar)(bar);
}

Changing template parameter to Bar.f or bar.f affects value of bar.f.data. Seems to be a bug.

Reply via email to