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

RSRP-469119: Resharper underscores awaitable IDisposable as error

$
0
0
Reporter zhukovskiy (Pzixel) zhukovskiy (Pzixel)
Created Apr 5, 2018 5:57:18 PM
Updated Apr 9, 2018 1:33:58 PM
Resolved Apr 9, 2018 1:33:58 PM
Subsystem Psi - C#
Assignee Andrew Karpov (andrew.karpov)
Priority Show-stopper
State Fixed
Type Bug
Fix version 2018.1
Affected versions No Affected versions
Fixed In Version ReSharper 2018.1 RTM
VsVersion All Versions

I'm working on an application that uses EasyMQ to interop with RabbitMQ queue.

This api has asyns and returns an IDisposable.
Here what I have

private async Task<IDisposable> ConsumeBus<T>(IAdvancedBus bus, string queueName, Func<ILogger, T, Task> messageConsumptionTask) where T : class
{
	var queue = await bus.QueueDeclareAsync(queueName).ConfigureAwait(false);
	return bus.Consume(
		queue,
		(body, properties, info) => WrapMessageInQueue(logger => ProcessMessageAsync(logger, body, messageConsumptionTask)));
}

Now I want to use it:

using (await ConsumeBus<Tender>(bus, "procedure_data", ProcessTender).ConfigureAwait(false))

It compiles fine, however, resharper is not able to recognize this code:

But if I introduce new variable it gray it out as unused.

Need more behaviour, because R# considers both options to be bad.


Viewing all articles
Browse latest Browse all 106942

Trending Articles



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