Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-288283: Strange warning for IDispatch implementation

$
0
0
Reporter Alex Berezoutsky (fergard) Alex Berezoutsky (fergard)
Created Feb 13, 2012 6:27:20 PM
Updated Feb 13, 2012 6:41:02 PM
Priority Major
Type Bug
Fix versions Next
State Submitted
Assignee Evgeny Pasynkov (pasynkov)
Subsystem No subsystem
Affected versions 6.1.1
Fixed in build No Fixed in build
The following code produced warning:

       public string ClientId
        {
            get { return DicomImage == null ? string.Empty : DicomImage.PatientID; }
        }

where

    [DispId(14)]
    string PatientID { [DispId(14), MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] get; [DispId(14), MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] set; }


"There exist both implicit conversion from 'string' and 'string' and from 'string' to 'string'"


After following the suggestion "Cast ' to 'string'"

        public string ClientId
        {
            get { return DicomImage == null ? string.Empty : (string) DicomImage.PatientID; }
        }

warning disappeared.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>