-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ComInterfaceGenerator] Custom enum return type in base interface unrecognized when processing derived interface #87915
Comments
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsDescriptionThe ComInterfaceGenerator throws an error when attempting to parse a derived interface whose base interface contains an unqualified custom enum type as the return type of a method. For example, attempting to compile the following code public enum HRESULT
{
}
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("4BBA36C0-20BB-4DFF-9241-71992D498B39")]
[GeneratedComInterface]
public partial interface Base
{
// Base will generate its wrapper successfully, but Derived will complain Base.M1's HRESULT type is unknown
HRESULT M1();
}
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("8BCFEC21-589D-45BC-908C-E038252F3453")]
[GeneratedComInterface]
public partial interface Derived : Base
{
HRESULT M2();
} generates the following errors
This behavior occurs regardless of whether Reproduction Stepspublic enum HRESULT
{
}
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("4BBA36C0-20BB-4DFF-9241-71992D498B39")]
[GeneratedComInterface]
public partial interface Base
{
HRESULT M1();
}
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("8BCFEC21-589D-45BC-908C-E038252F3453")]
[GeneratedComInterface]
public partial interface Derived : Base
{
HRESULT M2();
} Expected behaviorCustom return types are properly recognized without needing to fully qualify their namespaces Actual behavior
Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
I believe this has been fixed by #87661 |
@lordmilko We'll close this for now as I agree with @jkoritzinsky. Please let us know if this wasn't addressed in the next preview. |
Description
The ComInterfaceGenerator throws an error when attempting to parse a derived interface whose base interface contains an unqualified custom enum type as the return type of a method.
For example, attempting to compile the following code
generates the following errors
Derived
is modified to not derive fromBase
the application successfully compilesM1
to a runtime type likeint
successfully compilesM1
(e.g.ConsoleApp1.HRESULT M1()
) also successfully compilesHRESULT
toM1
with return typevoid
successfully compiles - the issue only occurs when our custom type is used as a return typeThis behavior occurs regardless of whether
PreserveSigAttribute
is specifiedReproduction Steps
Expected behavior
Custom return types are properly recognized without needing to fully qualify their namespaces
Actual behavior
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: