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

RSRP-294965: 2 overloads, one using 'params', results in incorrect marking of "Method with optional parameter is hidden by overload"

$
0
0
Reporter James Manning (James.Manning) James Manning (James.Manning)
Created Apr 16, 2012 10:11:35 PM
Updated Apr 16, 2012 10:11:35 PM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Evgeny Pasynkov (pasynkov)
Subsystem Code Analysis - Find Code Issues
Affected versions 7.0 Preview
Fixed in build No Fixed in build
JetBrains ReSharper 7 EAP for Visual Studio 11 Beta Full Edition Pre-Release
Build 7.0.14.191 on 2012-04-12T09:27:50
Visual Studio 11.0.50323.1.

The "params object[] args" is underlined with the error, but the sample code (and results in the sshot) show that's not actually the case since both are accessible fine (and this is a somewhat normal pattern for logging frameworks).

IMHO it shouldn't be triggering for 'params' entries, at least not using the term "optional parameter" since that's a different compiler feature.

class Program
{
static void Main(string[] args)
{
PrintSomething("foo");
PrintSomething("bar {0}", Math.PI);
}

static void PrintSomething(string message)
{
Console.WriteLine("no args: " + message);
}

static void PrintSomething(string message, params object[] args)
{
Console.WriteLine("with args: " + message, args);
}
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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