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

Report warning for exported generic types or methods #298

Open
jasongin opened this issue May 17, 2024 · 1 comment
Open

Report warning for exported generic types or methods #298

jasongin opened this issue May 17, 2024 · 1 comment
Assignees
Labels
bug Something isn't working build
Milestone

Comments

@jasongin
Copy link
Member

I'm splitting this out from #289. This issue will be about improving how the unsupported generic types and methods are handled by the build. #289 will be about adding (partial) support for exporting generic types and methods to JS from a .NET module.

The following are examples of unsupported generic exports:

[JSExport]
public class GenericClass<T> { ... }
public static class ClassWithGenericMethod
{
    [JSExport]
    public static void GenericMethod<T>();    
}

As requested, it may be better to report a warning rather than an error, so that the rest of the build is not blocked. And if generic types are referenced as parameters in other non-generic APIs, they would be marshalled as external/unknown so at least the values could be round-tripped through JS back to .NET.

@jasongin
Copy link
Member Author

jasongin commented Aug 1, 2024

This approach (report warning and marshal as external / unknown) should be used for any types which are not supported by the marshaller. Other examples are object and non-generic collections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build
Projects
None yet
Development

No branches or pull requests

1 participant