Search

[Visual C++] Intellisense bug with create_async by Simon FERQUEL

Closed
as Deferred Help for as Deferred

2
0
Sign in
to vote
Type: Bug
ID: 771931
Opened: 11/22/2012 3:03:43 AM
Access Restriction: Public
0
Workaround(s)
1
User(s) can reproduce this bug
I found a bug in the VC11 IntelliSense when mixing tasks and IAsyncOperations<T>^. Here is the code snippet that produce an IntelliSense error (but compile / run successfully):

IAsyncOperation<FileReadWriteProxy^>^ FileReadWriteProxy::FromFile(IStorageFile^ file, uint64 contentSize, uint64 alreadyWrittenLength, uint32 readBufferSize, Platform::String^ identity)
{
    task<FileReadWriteProxy^> task = create_task(file->OpenAsync(FileAccessMode::ReadWrite))
        .then([=](IRandomAccessStream^ fileStream)
    {

        return ref new FileReadWriteProxy(file, fileStream, contentSize, alreadyWrittenLength, readBufferSize, identity);
    });
    IAsyncOperation<FileReadWriteProxy^>^ asyncOp = create_async([=]{return task;});
    return asyncOp;
}


The error refers to the line "IAsyncOperation<FileReadWriteProxy^>^ asyncOp = create_async([=]{return task;});".
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

Steps to reproduce

I don't have an isolated reproduction, sorry.

Product Language

English

Operating System

Windows 8

Operating System Language

English

Actual results

IntelliSense error :
    1    IntelliSense: a value of type "Concurrency::details::_AsyncTaskGeneratorThunk<lambda []const Concurrency::task<QobuzNativeStreams::FileReadWriteProxy ^> ()->const Concurrency::task<QobuzNativeStreams::FileReadWriteProxy ^>> ^" cannot be used to initialize an entity of type "Windows::Foundation::IAsyncOperation<QobuzNativeStreams::FileReadWriteProxy ^> ^"    f:\ws\Qobuz_Windows8\Main\Qobuz\QobuzNativeStreams\FileReadWriteProxy.cpp    165    50    QobuzNativeStreams

Expected results

Should not give any IntelliSense error
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 11/27/2012 at 12:52 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/22/2012 at 6:02 PM
Thanks for your feedback.

In order to fix the issue, we must first reproduce the issue in our labs. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a simple repro project so that we can conduct further research?

Please submit this information to us within 3 business days. We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 11/22/2012 at 3:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.