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

Named generic typed arguments and omission of redundant type-parameters #615

Closed
weitzhandler opened this issue May 22, 2017 · 3 comments
Closed

Comments

@weitzhandler
Copy link

weitzhandler commented May 22, 2017

Hi,

It could be nice having an option to also have generic type named parameters:

public TChannel Proxy<TEntity, TProperty, TChannel>(TEntity entity, TProperty property);

Now we have 2 inferred args while the last one is not. Now in order for this function to work, we need to provide all the type-arguments when calling this method (i.e. var channel = this.Proxy<MyEntity, MyProperty, MyChannel>(entity, property);.

The goal is, if we have named type-parameters, so to be able to omit the redundant ones:

public TChannel Proxy<TEntity, p: TProperty, TChannel>(TEntity entity, TProperty property);

Usage:

var channel = this.Proxy<p:MyProperty>(entity, property);

Obviously there are nicer and more efficient ways to achieve this, I was merely opening this issue as a discussion board of this general idea, and if there is interest, then discuss the ways to implement that.
Although I tried to search before posting I couldn't find a similar one, I'd be delighted to find out this is been discussed already and would love to enrich my knowledge.

Thanks everybody!

@weitzhandler
Copy link
Author

Found it!
#253

@weitzhandler
Copy link
Author

Reopening since that issue was closed.

@weitzhandler weitzhandler reopened this May 22, 2017
@weitzhandler
Copy link
Author

weitzhandler commented May 22, 2017

Fixed with #280, #281.

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

No branches or pull requests

1 participant