ReSharper uses incorrect scope for attribute content

ReSharper will flag the first line of the following code as an error, even though it compiles!
(Sorry about the formatting, the forum is stripping my leading whitespace!)


// Should not be flagged by RS!
public class BrokenExample
{
private const string ExampleString = "example"; // RS incorrectly says unused
}


// qualifier not needed
public class WorkingExample
{
private const string ExampleString = "example";
}



public class StringAttribute : Attribute
{
private string _myString;

public StringAttribute( string myString )
{
_myString = myString;
}

public string MyString
{
get { return _myString; }
}
}

1 comment
Comment actions Permalink

Hello David,

Thank you for your feedback. Request was created: http://jetbrains.net/jira/browse/RSRP-30648

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


DM> // Should not be flagged by RS!
DM> public class BrokenExample
DM> {
DM> private const string ExampleString = "example"; // RS incorrectly
DM> says unused
DM> }
DM> // qualifier not
DM> needed
DM> public class WorkingExample
DM> {
DM> private const string ExampleString = "example";
DM> }
DM>
DM> public class StringAttribute : Attribute
DM> {
DM> private string _myString;
DM> public StringAttribute( string myString )
DM> {
DM> _myString = myString;
DM> }
DM> public string MyString
DM> {
DM> get { return _myString; }
DM> }
DM> }


0

Please sign in to leave a comment.