[Issue 9038] Template mixin identifier as template alias parameter issue

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 18 08:18:55 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9038



--- Comment #1 from Jack Applegame <japplegame at gmail.com> 2012-11-18 08:18:53 PST ---
Also another bug seems to have the same reason:

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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list