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

RSRP-288205: Type inference in String[] fails in cshtml and shows errors where are none

$
0
0
Reporter Wolfram Bernhardt (wolfram_bernhardt) Wolfram Bernhardt (wolfram_bernhardt)
Created Feb 8, 2012 4:01:49 PM
Updated Feb 8, 2012 4:01:49 PM
Priority Normal
Type Unspecified
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build No Fixed in build
@inherits System.Web.Mvc.WebViewPage<dynamic>

@{
ViewBag.Title = String.Join(" - ", new String[]
{
@Resources.Views.Shared.Layout.Title,
@Resources.Views.Manual.Shared.UserManual,
@Resources.Views.Manual.Shared.AppleI
});
}


R# (latest) reports errors for the three @Resources.Views... - lines,
saying "cannot convert expression of type 'void' to type 'string'"
Of course the ..Designser.cs-files that were generated from the resource-files return strings in every case.



When you remove the "String" from "String[]", the error disappears:

@inherits System.Web.Mvc.WebViewPage<dynamic>

@{
ViewBag.Title = String.Join(" - ", new[]
{
@Resources.Views.Shared.Layout.Title,
@Resources.Views.Manual.Shared.UserManual,
@Resources.Views.Manual.Shared.AppleI
});
}




When you write the @Resource in one line, the error disappears for the second and third part



@inherits System.Web.Mvc.WebViewPage<dynamic>

@{
ViewBag.Title = String.Join(" - ", new String[]
{
@Resources.Views.Shared.Layout.Title, @Resources.Views.Manual.Shared.UserManual, Resources.Views.Manual.Shared.AppleI });
}


Greetz,
Wolfram

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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