Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It feels like Microsoft.CodeAnalysis.CSharp.Symbols.SourceUserDefinedOperatorSymbolBase.CheckUserDefinedConversionSignature Should ignore tuple names when type symbols are compared #30659

Closed
AlekseyTs opened this issue Oct 23, 2018 · 3 comments

Comments

@AlekseyTs
Copy link
Contributor

            // SPEC: * S0 and T0 are different types:

            if ((ContainingType.SpecialType == SpecialType.System_Nullable_T) ? source == target : source0 == target0)
            if (source0 == this.ContainingType)
            {
                same = source;
                different = target;
            }
            else
            {
                same = target;
                different = source;
            }

@RikkiGibson
Copy link
Contributor

Is the comparison in question the source0 == this.ContainingType? It seems like comparing to SpecialType.System_Nullable_T shouldn't require tuple-specific compare kinds.

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Oct 26, 2018

This code seems to work--am I missing something about what this change is meant to fix?

namespace System
{
    struct ValueTuple<T1, T2>
    {
        public static explicit operator (T1 fst, T2 snd)((T1 one, T2 two) tuple)
        {
            return tuple;
        }
    }
}

https://sharplab.io/#v2:C4LglgNgNAJiDUAfAdgQwLYFMDOAHVAxpgAQACAjALABQA3jcY8dsAE4CuBwxAaqhO0wAVdrgiYAPEPJRiQgEwA+Bk3rUmGsgGYy5AGzFMADzFgCYbgHtcmVqmCXWxABTTiAMxayFzZDACUzq7kxJbImN7yxMAA7pb+0aLi/iqaxGppaaQA7IlimADcqZoAvsVl1CVAA

@AlekseyTs
Copy link
Contributor Author

@RikkiGibson Let's discuss questions you have offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants