roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Microsoft.DotNet.GenAPI.Tests/CSharpFileBuilderTests.cs in SDK repo test failures

Open MiYanni opened this issue 1 year ago • 1 comments

Summary

In dotnet/sdk, there were 2 tests marked against this original issue. That issue has been closed, but unskipping the tests still results in failure. This is to investigate those test failures.

TestInterfaceWithOperatorGeneration

Fails with:

    Expected:
    namespace A
    {
        public partial interface IntType
        {
            public static IntType operator +(IntType left, IntType right) => left + right;
        }
    }
    Resulted:
    namespace A
    {
        public partial interface IntType
        {
            static public IntType operator +(IntType left, IntType right) { throw null; };
        }
    }

TestInterfaceWithCheckedOperatorGeneration

Fails with:

    Expected:
    namespace A
    {
        public interface IAdditionOperators<TSelf, TOther, TResult>
            where TSelf : IAdditionOperators<TSelf, TOther, TResult>?
        {
            static abstract TResult operator +(TSelf left, TOther right);
            static virtual TResult operator checked +(TSelf left, TOther right) { throw null; }
        }
    }
    Resulted:
    namespace A
    {
        public partial interface IAdditionOperators<TSelf, TOther, TResult>
            where TSelf : IAdditionOperators<TSelf, TOther, TResult>?
        {
            static public abstract TResult operator +(TSelf left, TOther right) { throw null; };
            static public virtual TResult operator checked +(TSelf left, TOther right) { throw null; };
        }
    }

MiYanni avatar Jun 21 '24 22:06 MiYanni

Can you expand on what you think is a bug in the compiler?

jaredpar avatar Jun 27 '24 22:06 jaredpar

@jaredpar

Can you expand on what you think is a bug in the compiler?

I don't think there is a bug in the compiler. However, the tests were marked as Skip against an issue in this repo. That issue is closed and I cannot reopen it myself. So, I created this new issue in this repo to encompass these test failures and marked them as Skip against this one.

I'm doing this same process for every test skipped that I'm trying to unskip in this PR.

MiYanni avatar Jul 01 '24 21:07 MiYanni