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

Allow explicit return type object #186

Merged
merged 9 commits into from
Nov 25, 2021
Merged

Conversation

metoule
Copy link
Contributor

@metoule metoule commented Nov 14, 2021

No longer omit the conversion expression when the return type is explicitly object.
Force the return type of a lambda expression to typeof(void) to prevent the emission of a conversion expression.

Fixes #185

metoule and others added 3 commits November 14, 2021 20:36
…icitly object.

Force the return type of a lambda expression to typeof(void) to prevent the emission of a conversion expresssion.
Fixes dynamicexpresso#185
@davideicardi
Copy link
Member

Thank you! I will look at this better in the following days.
It looks a little wrong to use void in that case, maybe we can find some alternatives ...

@metoule
Copy link
Contributor Author

metoule commented Nov 15, 2021

I agree that it's a bit wrong to use void in that case.. I considered a few alternatives that didn't feel great either:

  • creating a dummy type DontEmitConversionExpression
  • add a new parser settings

In the end, since this is purely internal for when we parse a lambda expression, it seemed acceptable to use void to minimize the impact.

If you have a better idea, I'm all for it :)

@davideicardi
Copy link
Member

@metoule
I'm doing some experiments with the following solution #190 . It is still in progress and not sure that this will actually solve the problem or it will be feasible. But I will try ...
If you already have any kind of feedbacks please let me know.

If in some days I will not be able to complete it we can fallback to your solution, that in anycase looks like to be good. Ok?

Copy link
Member

@davideicardi davideicardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you as usual!

@metoule metoule merged commit ae65ecb into dynamicexpresso:master Nov 25, 2021
@metoule metoule deleted the fix_185 branch November 25, 2021 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug when trying to upcast a delegate return type
2 participants