Skip to content

ValueTuple.Equals issue #320

Open
Open
@ghost

Description

I tried this code:

Dim t1 As (Double, Single) = (1.0R, 2.0F)
Dim t2 As (Integer, Integer) = (1, 2)
Console.WriteLine(t1 = t2)

But VB.NET says:

Operator '=' is not defined for types '(Double, Single)' and '(Integer, Integer)'.

The unusual thing is that C# accepts this:

(double, float) t1 = (1d, 2f);
(int, int) t2 = (1, 2);
Console.WriteLine(t1 == t2);

Why can't VB.NET compare the two tuples, while C# can?
Note that VB.NET has no problem in assigning one of the tuples to the other one:
t1 = t2

Metadata

Metadata

Assignees

No one assigned

    Labels

    LDM ConsideringLDM has reviewed and we think this has merit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions