[Issue 8678] New: Wrong processing of Complex!double as function argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 17 08:41:22 PDT 2012


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

           Summary: Wrong processing of Complex!double as function
                    argument
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: maximzms at gmail.com


--- Comment #0 from Maksim Zholudev <maximzms at gmail.com> 2012-09-17 08:42:08 PDT ---
All examples are executed with rdmd 2.060 on 64-bit Linux system

Example 1:
----------
import std.stdio;

struct Foo(T)
{
    T a, b;
}

void foo(Foo!double a, double x)
{
    writeln(a);
}

void main()
{
    foo(Foo!double(0, 1), 2);
}
----------

Output:
----------
Foo!(double)(0, 0)
----------

Example 2:
----------
import std.stdio;
import std.complex;

void foo(Complex!double a, double x)
{
    writeln(a);
}

void main()
{
    foo(Complex!double(0, 1), 2);
}
----------

Output:
----------
0+0i
----------

Error also occurs for "float".
No error for "real" and "int".

-- 
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