-
Notifications
You must be signed in to change notification settings - Fork 301
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
Custom operator not used or resolved for erased type... sometimes. #2915
Comments
Sorry @IanManske! For some reason when reviewing the issues I confused this with #2880 and thought it was already fixed. This is a bit tricky because currently Fable discards type info for erased types so operator resolution (which needs the type info as it works similar to SRTP) doesn't work. We're currently considering to include the type info for erased types which hopefully should make this work. See #2914 |
No worries! Thanks for the response. |
Ah, yeah. You're right! I guess we'll have to keep the full type info and "erase" only when emitting the final JS code. |
Description
For an erased type, a custom member operator sometimes doesn't get used or resolved. The code below shows a function that correctly applies the operator and another that incorrectly ends up using the default
+
operator in the outputted JS. Changing the custom operator from+
to==
gives fable compile errors for both functions:Cannot resolve trait call
. Removing theErase
attribute causes the code to compile correctly in both cases.Repo code
REPL Code.
Expected and actual results
Expected:
Actual:
Related information
The text was updated successfully, but these errors were encountered: