Re: EAP 2.5 feedback?

if (this is ICompositeTree && (this as ICompositeTree).IsReparenting())

The above gives a NRE under 'this as ICompositeTree'.....presumably a bug?


5 comments
Comment actions Permalink

This is fixed in buld 301

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Sean Kearon" <no@spam.org> wrote in message
news:adc66bd29d68c8cfbb427833c4@news.jetbrains.com...

Similarly....

>

if (item is IDefinedOutput)
{
return (item as IDefinedOutput).GetCsvHeaders();
}

>

identifies 'item as IDefinedOutput' as possible NRE.

>



0
Comment actions Permalink

Thanks Eugene.


0
Comment actions Permalink

Sean Kearon schrieb:

if (item is IDefinedOutput)
{
return (item as IDefinedOutput).GetCsvHeaders();
}

identifies 'item as IDefinedOutput' as possible NRE.


This should result in an QuickFix for.


if (item is IDefinedOutput)
{
return (IDefinedOutput)item).GetCsvHeaders();
}


Cause a "soft cast" with as is doing a check before casting and the fill
a null in item if the type is not correct, but an "hard cast" does
(maybe i'm wrong) don't do that check and maybe "crashed" on
.GetCsvHeaders() if the type is wrong.

Regards
Albert



0
Comment actions Permalink

Sean Kearon schrieb:

>> if (item is IDefinedOutput)
>> {
>> return (item as IDefinedOutput).GetCsvHeaders();
>> }
>> identifies 'item as IDefinedOutput' as possible NRE.
>>

This should result in an QuickFix for.

if (item is IDefinedOutput)
{
return (IDefinedOutput)item).GetCsvHeaders();
}
Cause a "soft cast" with as is doing a check before casting and the
fill a null in item if the type is not correct, but an "hard cast"
does (maybe i'm wrong) don't do that check and maybe "crashed" on
.GetCsvHeaders() if the type is wrong.

Regards
Albert


Sure - I guess that it doesn't really matter after the type check, but I
always use the soft cast wherever possible as I find the code more readable,
so I'd like R# to support both styles, please :)

Cheers

Sean


0

Please sign in to leave a comment.