Skip to content

Constant evaluator support for member constants #16056

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

matheusaaguiar
Copy link
Collaborator

Fix #16055.

@matheusaaguiar matheusaaguiar self-assigned this May 18, 2025
@matheusaaguiar matheusaaguiar force-pushed the constantEvaluatorSupportForMemberAccess branch 2 times, most recently from 93d7f5a to 78e1d3e Compare May 19, 2025 04:41
@matheusaaguiar matheusaaguiar marked this pull request as ready for review May 19, 2025 04:41
@matheusaaguiar matheusaaguiar force-pushed the constantEvaluatorSupportForMemberAccess branch from 1e7955b to 985b03f Compare May 20, 2025 15:13
Copy link
Member

@clonker clonker left a comment

Choose a reason for hiding this comment

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

I am not sure if there aren't any unwanted side-effects hiding in this. Looks good to me generally, though!

@matheusaaguiar matheusaaguiar force-pushed the constantEvaluatorSupportForMemberAccess branch from ad3f23a to 7fa4363 Compare May 22, 2025 22:26
@@ -407,3 +409,24 @@ void ConstantEvaluator::endVisit(TupleExpression const& _tuple)
if (!_tuple.isInlineArray() && _tuple.components().size() == 1)
m_values[&_tuple] = evaluate(*_tuple.components().front());
}

void ConstantEvaluator::endVisit(MemberAccess const& _memberAcess)
Copy link
Member

Choose a reason for hiding this comment

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

Sorry I just see this now, there's a typo here...

Suggested change
void ConstantEvaluator::endVisit(MemberAccess const& _memberAcess)
void ConstantEvaluator::endVisit(MemberAccess const& _memberAccess)

Copy link
Member

@clonker clonker left a comment

Choose a reason for hiding this comment

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

LGTM aside from the typo

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.

Compile-time evaluation of constants of member constants
2 participants