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

Types without extension methods should remain nested UserQuery #30

Closed
atifaziz opened this issue Sep 19, 2019 · 0 comments
Closed

Types without extension methods should remain nested UserQuery #30

atifaziz opened this issue Sep 19, 2019 · 0 comments
Assignees
Labels

Comments

@atifaziz
Copy link
Owner

The following LINQPad program query:

void Main()
{
    Print(NestedClass.StaticMethod      );
    Print(NestedStruct.StaticMethod     );
    Print(NestedStaticClass.StaticMethod);
    Print(default(object).Extension     );
    Print(Extensions.StaticMethod       );
}

static void Print(Action a) =>
    Console.WriteLine($"{a.Method.DeclaringType.FullName}::{a.Method.Name}");

struct NestedStruct
{
    public static void StaticMethod() {}
}

class NestedClass
{
    public static void StaticMethod() {}
}

static class NestedStaticClass
{
    public static void StaticMethod() {}
}

static class Extensions
{
    public static void StaticMethod() {}
    public static void Extension<T>(this T _) {}
}

displays the following in LINQPad (tested with version 6):

UserQuery+NestedClass::StaticMethod
UserQuery+NestedStruct::StaticMethod
UserQuery+NestedStaticClass::StaticMethod
Extensions::Extension
Extensions::StaticMethod

When run with LINQPadless, this produces:

NestedClass::StaticMethod
NestedStruct::StaticMethod
NestedStaticClass::StaticMethod
Extensions::Extension
Extensions::StaticMethod

Tested with version at 27c3fb6.

@atifaziz atifaziz added the bug label Sep 19, 2019
@atifaziz atifaziz self-assigned this Sep 19, 2019
atifaziz added a commit to atifaziz/LinqPadlessProgramTemplate that referenced this issue Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant