Skip to content

Conversation

@kennykerr
Copy link
Collaborator

Fixes #1062

@kennykerr kennykerr changed the title Allow static setter methods when compiling with -opt Allow non-void static setter methods when compiling with -opt Nov 19, 2021
@oldnewthing
Copy link
Member

Similar problem exists with void methods.

namespace MyProject
{
    static runtimeclass Sample
    {
        static void M1();
    }
}
namespace winrt::MyProject::implementation
{
    struct Sample
    {
        Sample() = default;

        static int M1() { return 1; }
    };
}

Code gen:

WINRT_EXPORT namespace winrt::MyProject
{
    void Sample::M1()
    {
        return MyProject::implementation::Sample::M1(); // error: returning value from non-void function
    }
}

@kennykerr
Copy link
Collaborator Author

@oldnewthing good catch - updated.

@kennykerr kennykerr merged commit e192094 into master Nov 19, 2021
@kennykerr kennykerr deleted the async-setter branch November 19, 2021 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow async property setter

3 participants