CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Adding an attribute class makes the build fail with an unrelated error

Open asklar opened this issue 2 years ago • 3 comments

Describe the bug Adding a class that derives from Attribute will cause the build to fail with an unrelated error

To Reproduce

namespace CSWinRT_AuthoringPlayground
{
    public sealed class X {}

    // Commenting the following line makes the build succeed
    public sealed class MyAttr : Attribute { }

}

Produces the error: error CS0246: The type or namespace name 'IXClass' could not be found (are you missing a using directive or an assembly reference?)

Expected behavior Build succeeds with proper output

Version Info CsWinRT 1.6.4

asklar avatar Jun 15 '22 08:06 asklar

the issue seems to be bad codegen from the generator, see how IntelliSense thinks the class name is global and errors out once it encounters the :: etc.: image

asklar avatar Jun 15 '22 08:06 asklar

@asklar Is this more-or-less the same issue we saw yesterday with Windows.Foundation.Point not being found?

j0shuams avatar Jun 28 '22 20:06 j0shuams

@j0shuams this is a different one- this one is about the generator outputting invalid C# code

asklar avatar Jun 28 '22 20:06 asklar