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

Fix type instance conversion #92

Conversation

jhonabreul
Copy link
Collaborator

@jhonabreul jhonabreul commented May 10, 2024

  • Fix type instance conversion to managed value.
  • In the method binder overload matching loop, if there are multiple matches and one of the input arguments is a type instance, but one of the overloads have a different type in the same positional argument, the conversion fails here and sets an error, which will be thrown or mess with something later on even if there is a match.
    • This was reproduced in Overloaded AddData Method Broken Lean#8011
      • There are multiple matches for the AddData call but some of them have the issue described above (like trying to convert the input type CustomData to String, since there is an overload with a String as first parameter). The error gets set and not cleared, messing with later actions.
  • Additional fix: overload matching for methods with named arguments and overloads with very similar signatures.
  • Additional: no implicit conversion to primitive bool.

Closes QuantConnect/Lean#8011

Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

@jhonabreul jhonabreul merged commit 8fb227a into QuantConnect:master May 14, 2024
0 of 21 checks passed
@jhonabreul jhonabreul deleted the bug-error-set-even-with-matched-overload branch May 14, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overloaded AddData Method Broken
2 participants