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

[NF] update discrete real check #6744

Merged
merged 1 commit into from Sep 11, 2020
Merged

Conversation

kabdelhak
Copy link
Contributor

  • correct support for array element types

algorithm
isReal := match ty
case REAL() then true;
case ARRAY(elementType = REAL()) then true;
Copy link
Contributor

Choose a reason for hiding this comment

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

That's no recursion. Did you mean case ARRAY() then isRealRecursive(ty.elementType);?
Or did we say goodbye to recursive arrays? 😄

Copy link
Contributor Author

@kabdelhak kabdelhak Sep 11, 2020

Choose a reason for hiding this comment

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

yes that is what i intended to do :D Seems like i only updated the name but not the function...

Copy link
Member

Choose a reason for hiding this comment

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

A better name would perhaps be isRealElementType to conform to the existing names (the function is basically equivalent to Type.isReal(Type.arrayElementType(ty))).

Copy link
Contributor Author

@kabdelhak kabdelhak Sep 11, 2020

Choose a reason for hiding this comment

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

Yea, but i wanted to be safe if there is any form of recursion e.g. and array containing in an array containing an array etc. And it should also return true for just REAL().

Copy link
Member

Choose a reason for hiding this comment

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

Yes, Type.arrayElementType returns either the innermost element type of an array type or the type itself.

 - correct support for array element types
@adrpo adrpo merged commit 2f08035 into OpenModelica:master Sep 11, 2020
@kabdelhak kabdelhak deleted the 5836_add_array branch March 10, 2022 12:55
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.

None yet

4 participants