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

[c# support] implicit ToExpression for parameters #158

Closed
ghost opened this issue Oct 25, 2011 · 4 comments
Closed

[c# support] implicit ToExpression for parameters #158

ghost opened this issue Oct 25, 2011 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 25, 2011

using System;
using Nemerle.Linq;

public class DD
{
    void Test()
    {
         this.T1<string>(ToExpression(s => T2(s)));    //this compile fine
         this.T1<string>(s => T2(s));   // this works fine in ms c# compiler, but not in nemerle parser
    }

    public void T1<T>(System.Linq.Expressions.Expression<Action<T>> e)
    {
    }
    void T2(string s)
    {
        //return s;
    }
}

The ToExpession work well for nemerle since there are no legacy code. but it will break a lot of existing code in c#(e.g. test code using Moq). Could we make this conversion implicit at least in c# support? Is there any better workaround for this?

@VladD2
Copy link
Member

VladD2 commented Oct 28, 2011

I try to compile this examople and it compile fine.

@ghost ghost closed this as completed Oct 28, 2011
@ghost
Copy link
Author

ghost commented Oct 28, 2011

you are right. this works great in the latest build now. very nice! it must
be fixed when fixing other bugs. i have closed this issue.

On Fri, Oct 28, 2011 at 11:45 AM, VladD2 <
reply@reply.github.com>wrote:

I try to compile this examople and it compile fine.

Reply to this email directly or view it on GitHub:
#158 (comment)

@VladD2
Copy link
Member

VladD2 commented Oct 28, 2011

Maybe case had been that return type T2 was string?

@ghost
Copy link
Author

ghost commented Oct 28, 2011

Actually this issue is first raised here and this is where I get the idea to
ToExpression from:
http://groups.google.com/group/nemerle-en/browse_thread/thread/c723f6d75f30f633

Maybe this will give you some hint on this? Fixing this issue actually will
make most c# code using Moq compile in nemerle without any change.

On Fri, Oct 28, 2011 at 12:32 PM, VladD2 <
reply@reply.github.com>wrote:

Maybe case had been that type T2 was string?

Reply to this email directly or view it on GitHub:
#158 (comment)

This issue was closed.
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

1 participant