Skip to content

Nested Structs lose partial keyword #2

Description

@Soaryn

Problem:

PolymorphicStructs that are created in a nested structs, according to the IDE (Rider), don't have a partial sibling related to it.. This breaks compilation.

Example

namespace Playground.ExamplePoly {
    [PolymorphicStruct]
    public interface IPoly {
        public void DoThing();
    }
}
namespace Playground.ExamplePoly {
    public class NestedExample {
        public partial struct PolyB : IPoly {
            public void DoThing() { }
        }
    }
}

Potential Related Issues

Static or type definition using statements are lost on source generation. Examples below of what is written vs what is generated.

using static Playground.ExamplePoly.NestedExample.PolyB; //This example is not using both at the same time, but the result is the same.
using PolyB = Playground.ExamplePoly.NestedExample.PolyB;

Result:

using Playground.ExamplePoly.NestedExample.PolyB;

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions