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

RSRP-469313: Module should not be referenced (bis)

$
0
0
Reporter Vianney PHILIPPE (vianney) Vianney PHILIPPE (vianney)
Created Apr 18, 2018 4:00:15 PM
Updated Apr 18, 2018 4:00:45 PM
Subsystem No Subsystem
Assignee Unassigned
Priority Normal
State Submitted
Type Unspecified
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Similar to RSRP-468697.

New code :

ProjectTest.csproj

class StuffCollection
{
public StuffCollection(IEnumerable<Stuff> array)
{
Values = array;
}
public IEnumerable<Stuff> Values { get; }
}

[TestFixture]
class Fixture
{
[Test] public void Test()
{
var details = new[] { new Stuff("foo") };
var collection = new StuffCollection(details);
Assert.IsNotNull(details);
}
}

Expected

No error.

Actual

At new StuffCollection(details), Module Api should be referenced.

Alternative solution

Cast details array as IEnumerable<Stuff> fixes the problem.

Versions

Resharper Ultimate 2018.1.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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