[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
Please sign in to leave a comment.
Hello, Laurent,
Thank you for your feedback. Could you post this issue to the tracker (http://www.intellij.net/tracker/resharper/browse)?
Thanks,
Andrey Simanovsky
Hello Andrey,
done
Best Regards,
---
Laurent Kempé - laurent.kempe@techheadbrothers.com
Tech Head Brothers - http://www.TechHeadBrothers.com
Blog - http://weblogs.asp.net/lkempe
>> 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
>>
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...
>
>
>
>
>
>
>
>
>
>