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

Translate DS array to NET array for description #11040

Merged
merged 1 commit into from
Aug 24, 2020

Conversation

mmisol
Copy link
Collaborator

@mmisol mmisol commented Aug 24, 2020

Purpose

This fixes a bug where the description of Curve.SplitByParameter in the
library would show up a description of an obsoleted overload.

The cause of the issue was the inability of XmlDocumentationExtensions
to handle conversion from primitve DS arrays to their equivalent .NET
arrays. This made the module unable to find the exact overload, so it
resorted to a fallback which returns the first overload available,
which in this case was the incorrect one.

The problem is fixed for this particular instance, as it is now able to
find the exact overload. Note, however, that the mechanism is not
bullet-proof, as there is no guaranteed way to translate back a type
from DS to the original .NET type.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@aparajit-pratap @QilongTang

FYIs

@DynamoDS/dynamo

This fixes a bug where the description of Curve.SplitByParameter in the
library would show up a description of an obsoleted overload.

The cause of the issue was the inability of XmlDocumentationExtensions
to handle conversion from primitve DS arrays to their equivalent .NET
arrays. This made the module unable to find the exact overload, so it
resorted to a fallback which returns the first overload available,
which in this case was the incorrect one.

The problem is fixed for this particular instance, as it is now able to
find the exact overload. Note, however, that the mechanism is not
bullet-proof, as there is no guaranteed way to translate back a type
from DS to the original .NET type.
@@ -211,12 +217,20 @@ private static string PrimitiveMap(string s)
return "System.Object";
case "double":
return "System.Double";
case "double[]":
return "System.Double[]";
Copy link
Contributor

Choose a reason for hiding this comment

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

@mmisol this could also be an IEnumerable or IList, etc., right? Is that why you say this is not foolproof?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mmisol mmisol merged commit c04ea0b into DynamoDS:master Aug 24, 2020
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.

2 participants