dotnet / dotnet/vblang

ValueTuple.Equals issue

Open
#320 31 comments 2 reactions 0 assignees View on GitHub
LDM Considering
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.