[Issue 11344] [2.064 beta] Error: object.destroy called with argument types matches both

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 25 02:08:27 PDT 2013


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



--- Comment #2 from rswhite4 at googlemail.com 2013-10-25 02:08:16 PDT ---
Seems that there is something wrong with the array specialization.
This prints almost the same error messages:
-----
import std.stdio;

struct vec2f {
public:
    float[2] values;

    alias values this;
}

void foo(T)(ref T obj) if (is(T == struct)) {
    writeln("#1");
}

void foo(T : U[n], U, size_t n)(ref T obj) {
    writeln("#2");
}

void main() {
    vec2f v;

    foo!vec2f(v);
    foo(v);
    foo(v.values);
}
----

But this works fine:
----
import std.stdio;
import std.traits;

struct vec2f {
public:
    float[2] values;

    alias values this;
}

void foo(T)(ref T obj) if (is(T == struct)) {
    writeln("#1");
}

void foo(T)(ref T obj) if (isStaticArray!T) {
    writeln("#2");
}

void main() {
    vec2f v;

    foo!vec2f(v);
    foo(v);
    foo(v.values);
}
----

And prints the expected result:
#1
#1
#2

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