[Issue 4960] dmd 2.049 rejects code containing templates with a uint as template parameter
https://issues.dlang.org/show_bug.cgi?id=4960 Andrei Alexandrescu changed: What|Removed |Added Status|NEW |RESOLVED CC||and...@erdani.com Resolution|--- |FIXED --- Comment #5 from Andrei Alexandrescu --- All examples given compile and run with 2.072.1. --
[Issue 4960] dmd 2.049 rejects code containing templates with a uint as template parameter
http://d.puremagic.com/issues/show_bug.cgi?id=4960 Andrej Mitrovic changed: What|Removed |Added CC||andrej.mitrov...@gmail.com --- Comment #4 from Andrej Mitrovic 2012-12-20 13:05:57 PST --- As a workaround you can use an enum instead of a const uint. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4960] dmd 2.049 rejects code containing templates with a uint as template parameter
http://d.puremagic.com/issues/show_bug.cgi?id=4960 --- Comment #3 from captainsi...@web.de 2010-10-01 02:00:22 PDT --- I agree, your issue sounds similar, but in contrast to your code where there might be a slight difference between the types because the template takes an uint and you instantiate it with an int literal, my example uses uints exclusively and the parameter dimension is typed as an uint. So, there should be no reason for ambiguity... I just tested your programs and they compiled with dmd 2.049... Whereas changing austins example to using int doesn't lead to an compiling program... Essentially I don't get what's going wrong now... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4960] dmd 2.049 rejects code containing templates with a uint as template parameter
http://d.puremagic.com/issues/show_bug.cgi?id=4960 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #2 from bearophile_h...@eml.cc 2010-09-30 10:32:03 PDT --- Also note the effect of this version of the same program: template MeanField(int dim) { class U { cdouble opCall() { return 0.0 + 0.0i; } } } void chargeChargeEntry(int dim)(MeanField!(dim).U time) { pragma(msg, MeanField!(dim).U.mangleof); } void main() { alias MeanField!(1).U TimeEvolver; TimeEvolver timeEvolver = new TimeEvolver; pragma(msg, TimeEvolver.mangleof); chargeChargeEntry!(1)(timeEvolver); } Or even this version: class U(int dim) { cdouble opCall() { return 0.0 + 0.0i; } } void chargeChargeEntry(int dim)(U!dim time) { pragma(msg, (U!dim).mangleof); } void main() { alias U!1 TimeEvolver; TimeEvolver timeEvolver = new TimeEvolver; pragma(msg, TimeEvolver.mangleof); chargeChargeEntry!(1)(timeEvolver); } See also bug 3467 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4960] dmd 2.049 rejects code containing templates with a uint as template parameter
http://d.puremagic.com/issues/show_bug.cgi?id=4960 Austin Hastings changed: What|Removed |Added CC||ah0801...@yahoo.com --- Comment #1 from Austin Hastings 2010-09-30 10:24:52 PDT --- I get similar behavior on windows. Here is a smaller bit of code that reproduces the issue (I think): == class U(uint dim) { } void chargecharge_entry(uint dim)( U!(dim) time ) { //pragma(msg, "param: " ~ typeof( time ).mangleof); } void main() { const uint dimension = 1; alias U!(dimension) TimeEvolver; //pragma(msg, "main: " ~ TimeEvolver.mangleof); chargecharge_entry!(dimension)( new TimeEvolver ); } == For me emits: test.d(41): Error: cannot implicitly convert expression (new U) of type test.main.U!(dimension).U to test.U!(dim).U -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---