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

Improve type testing #2092

Closed
alfonsogarciacaro opened this issue Jun 13, 2020 · 2 comments
Closed

Improve type testing #2092

alfonsogarciacaro opened this issue Jun 13, 2020 · 2 comments
Labels

Comments

@alfonsogarciacaro
Copy link
Member

Following the increased reflection support we could try to overcome the current limitations in Fable's type testing:

  • Allow testing interfaces (except the NoMangle ones as they're supposed to represent JS objects). For that we should include the implemented interface names in the type (we already did something similar in Fable 1).
  • Allow testing generic types. For that we need to inject the name of generic arguments to the constructors.
@Shmew
Copy link
Contributor

Shmew commented Jun 17, 2020

This would be great look at this gross code 😅

@alfonsogarciacaro
Copy link
Member Author

I've tried different approaches: injecting generics as arguments, wrapping the constructors, trying to infer the generics from private fields... but I was not convinced by anyone, as none was perfect and they introduced complications without opening interesting scenarios. The only cases I've seen this is need is to cross-compile code for .net and Fable, so for now I will just enable testing generic types with a warning saying the generics are not taken into account. Hopefully that should be enough for most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants