Skip to content
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

Generator crash on class that doesn't implement an interface correctly #940

Closed
asklar opened this issue Jul 29, 2021 · 1 comment · Fixed by #942
Closed

Generator crash on class that doesn't implement an interface correctly #940

asklar opened this issue Jul 29, 2021 · 1 comment · Fixed by #942
Labels
authoring Related to authoring feature work bug Something isn't working cswinmd

Comments

@asklar
Copy link
Member

asklar commented Jul 29, 2021

The code below is incorrect (Class1 doesn't implement Interface1 correctly since f takes a float instead of a MyEnum).
However, the generator will crash, instead of emitting diagnostics.

namespace CppComponent
{
    public enum MyEnum
    {
        Value1 = 42,
        Value2 = 99
    }

    public interface Interface1
    {
        void f(int x, MyEnum y);
    }

    sealed public class Class1 : Interface1
    {
        public void f(int x, float y);
    }
}
@asklar asklar added the bug Something isn't working label Jul 29, 2021
@manodasanW
Copy link
Member

We might need a diagnostic to check all the methods to ensure it correctly implements the interface, but I would also expect C# built-in diagnostics to catch it. We should look at why it isn't.

@manodasanW manodasanW added the authoring Related to authoring feature work label Jul 29, 2021
@asklar asklar added the cswinmd label Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authoring Related to authoring feature work bug Something isn't working cswinmd
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants