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

RSRP-288166: ReSharper does not respect @using to disambiguate types in Razor

$
0
0
Reporter Kirk Woll (kirk1) Kirk Woll (kirk1)
Created Feb 4, 2012 11:23:17 PM
Updated Feb 5, 2012 2:04:24 AM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
Affected versions 6.1.1
Fixed in build No Fixed in build
In a Razor view, ReSharper ignores @using lines to disambiguate types with the same name. For example, I have a type in my project named "Authorization" (it's an enum). At the top of my view, I have the line:

@using Authorization = Contracts.Authorization

Unfortunately, ReSharper appears to ignore this line, so that when I make use of this enum in my view, for example:

if (user.IsAuthorized(Authorization.ViewLog)) { ... }

ReSharper underlines "Authorization" with the error:

Ambiguous reference:
Contracts.Authorization
Contracts.Authorization
System.Net.Authorization
match

Now, there are two problems:

1) It is complaining about two types with exactly the same name. My web project only has one reference to the "Contracts" project. When I try to "go to declaration", however, only one of my types appears (as I'd expect).

2) It is complaining about System.Net.Authorization, which is a bug since I disambiguated it at the top.

It should go without saying that this view renders and functions perfectly except for ReSharper's spurious complaints.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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