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

RSRP-287424: Incorrect message: "The as operator must be used with a reference type"

$
0
0
Reporter Peter Hoogenboom (phoogenb) Peter Hoogenboom (phoogenb)
Created Dec 28, 2011 1:55:04 AM
Updated Feb 17, 2012 11:13:42 PM
Resolved Feb 17, 2012 5:10:27 PM
Priority Normal
Type Unspecified
Fix versions Next
State Fixed
Assignee Evgeny Pasynkov (pasynkov)
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build 6.5.1.4627
Beginning with C# 2.0, the as operator also supports nullable types (which are not reference types). ReSharper flags the line

var n = 255 as byte;

with

The as operator must be used with a reference type ('byte' is a value type)

but the corresponding compiler error in C# 4.0 is

The as operator must be used with a reference type or nullable type ('byte' is a non-nullable value type)

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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