August 14, 2008 [Issue 2284] New: template is instantiated not properly when instantiated twise with different types | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2284 Summary: template is instantiated not properly when instantiated twise with different types Product: D Version: unspecified Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: 2korden@gmail.com I have the following code that does simple type checking: void check(T)(T t) { writefln(T.mangleof); writefln(typeof(t).mangleof); writefln(T.sizeof); writefln(typeof(t).sizeof); writefln(T.stringof); writefln(typeof(t).stringof); } It should output the same information twice, since is(typeof(t) == T) is true. Let's run tests: Test one: check(42); Output: i i 4 4 int int Test two: check(0.0); Output: d d 8 8 double double Ok so far. Test three: check(42); check(0.0); Output: i i 4 4 int int d i 8 4 double int Whoops! Results got mixed. Looks like typeof(t) returns wrong result now! -- |
September 04, 2009 [Issue 2284] template is instantiated not properly when instantiated twice with different types | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2284 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |clugdbug@yahoo.com.au Resolution| |FIXED --- Comment #1 from Don <clugdbug@yahoo.com.au> 2009-09-04 03:09:56 PDT --- This was fixed in DMD1.039 when bug 2527 was fixed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation