Incorrect warning in LINQ expression with Nullable

I just ran into another new ReSharper 5.1 warning, that I think is not correct:

from result in _results
where result.AreaNormalized.HasValue
select result.AreaNormalized.Value

The select statement is underlined with the warning, "Possible 'System.InvalidOperationException'".  It seems to me that the 'where' clause protects against this, no?

Thanks.  I'd like to get my code v5.1 clean, but it is starting to look like that may not be possible in some cases.

--Brendan

1 comment
Comment actions Permalink

Hello Brendan,

Thank you for reporting this poblem! We already have corresponding issue
logged in our bug-tracker: http://youtrack.jetbrains.net/issue/RSRP-188273
and you're welcome to monitor its status.

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I just ran into another new ReSharper 5.1 warning, that I think is not
correct:

from result in _results
where result.AreaNormalized.HasValue
select result.AreaNormalized.Value
The select statement is underlined with the warning, "Possible
'System.InvalidOperationException'".  It seems to me that the 'where'
clause protects against this, no?

Thanks.  I'd like to get my code v5.1 clean, but it is starting to
look like that may not be possible in some cases.

--Brendan

---
Original message URL:
http://devnet.jetbrains.net/message/5276033#5276033



0

Please sign in to leave a comment.