[Build 208] Generics Converter

Hi,

With such a piece of code:

private static Converter<Category, ICategory> ToInterface()
{
return delegate(Category category)
{
return category; <--- error
};
}

I get an error: cannot convert expression type Category to return type TOutput

Converter signature is following:
public delegate TOutput Converter<TInput,TOutput>(TInput input)

So in my case TOuput is a ICategory, Category inherit from ICategory, so
for sure it is ok and should not be displayed as an issue.

And if I follow the tip diplayed I get:

private static Category ToInterface()
{
return delegate(Category category)
{
return category;
};
}

That is abolutely wrong.

Best Regards,
---
Laurent Kempé - laurent.kempe@techheadbrothers.com
Tech Head Brothers - http://www.TechHeadBrothers.com
Blog - http://weblogs.asp.net/lkempe



3 comments
Comment actions Permalink

Hello, Laurent,

Thank you for your feedback. Could you post this issue to the tracker (http://www.intellij.net/tracker/resharper/browse)?

Hi,

With such a piece of code:

private static Converter<Category, ICategory> ToInterface()
{
return delegate(Category category)
{
return category; <--- error
};
}
I get an error: cannot convert expression type Category to return type
TOutput

Converter signature is following:
public delegate TOutput Converter<TInput,TOutput>(TInput input)
So in my case TOuput is a ICategory, Category inherit from ICategory,
so for sure it is ok and should not be displayed as an issue.

And if I follow the tip diplayed I get:

private static Category ToInterface()
{
return delegate(Category category)
{
return category;
};
}
That is abolutely wrong.

Best Regards,
---
Laurent Kempé - laurent.kempe@techheadbrothers.com
Tech Head Brothers - http://www.TechHeadBrothers.com
Blog - http://weblogs.asp.net/lkempe

Thanks,
Andrey Simanovsky


0
Comment actions Permalink

Hello Andrey,

done

Best Regards,
---
Laurent Kempé - laurent.kempe@techheadbrothers.com
Tech Head Brothers - http://www.TechHeadBrothers.com
Blog - http://weblogs.asp.net/lkempe

Hello, Laurent,

Thank you for your feedback. Could you post this issue to the tracker
(http://www.intellij.net/tracker/resharper/browse)?

>> Hi,
>>
>> With such a piece of code:
>>
>> private static Converter<Category, ICategory> ToInterface()
>> {
>> return delegate(Category category)
>> {
>> return category; <--- error
>> };
>> }
>> I get an error: cannot convert expression type Category to return
>> type
>> TOutput
>> Converter signature is following:
>> public delegate TOutput Converter<TInput,TOutput>(TInput input)
>> So in my case TOuput is a ICategory, Category inherit from
>> ICategory,
>> so for sure it is ok and should not be displayed as an issue.
>> And if I follow the tip diplayed I get:
>>
>> private static Category ToInterface()
>> {
>> return delegate(Category category)
>> {
>> return category;
>> };
>> }
>> That is abolutely wrong.
>> Best Regards,
>> ---
>> Laurent Kempé - laurent.kempe@techheadbrothers.com
>> Tech Head Brothers - http://www.TechHeadBrothers.com
>> Blog - http://weblogs.asp.net/lkempe
>>

Thanks,
Andrey Simanovsky



0
Comment actions Permalink

Fixed in 209

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Laurent Kempé" <laurent.kempe@techheadbrothers.com> wrote in message
news:72b6183721a488c7a7bc223be7c0@news.jetbrains.com...

Hi,

>

With such a piece of code:

>

private static Converter<Category, ICategory> ToInterface()
{
return delegate(Category category)
{
return category; <--- error
};
}

>

I get an error: cannot convert expression type Category to return type
TOutput

>

Converter signature is following:
public delegate TOutput Converter<TInput,TOutput>(TInput input)

>

So in my case TOuput is a ICategory, Category inherit from ICategory, so
for sure it is ok and should not be displayed as an issue.

>

And if I follow the tip diplayed I get:

>

private static Category ToInterface()
{
return delegate(Category category)
{
return category;
};
}

>

That is abolutely wrong.

>

Best Regards,
---
Laurent Kempé - laurent.kempe@techheadbrothers.com
Tech Head Brothers - http://www.TechHeadBrothers.com
Blog - http://weblogs.asp.net/lkempe

>



0

Please sign in to leave a comment.