Skip to content

Print a warning when Expression.value() is invoked during discovery #1257

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

Merged
merged 7 commits into from
Oct 12, 2022

Conversation

Berlioz
Copy link
Contributor

@Berlioz Berlioz commented Oct 10, 2022

This is the neatest way I can think of to implement this off the top of my head, which means there's an excellent chance that there's a neater way to do it that I didn't think of.

@Berlioz Berlioz requested review from jhuleatt and taeold October 10, 2022 23:04
return this.runtimeValue();
}

// @internal
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need @internal tag on all of implementation of runtimeValue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly, and while I was down the rabbit hole of looking that up, I also realized that tsc doesn't respect jsdoc annotations unless they're in, well, jsdoc format, so fixing that too.

Comment on lines +87 to +88
runtimeValue(): T {
return this.test.runtimeValue() ? valueOf(this.ifTrue) : valueOf(this.ifFalse);
Copy link
Contributor

Choose a reason for hiding this comment

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

woah we are renaming value to runtimeValue()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not from users' perspective. They'll still call value(), which will use the implementation in the base Expression class, which will do the discovery check and then call runtimeValue()

@Berlioz Berlioz force-pushed the warn_on_exec_value branch from 8bfbb09 to bf724c4 Compare October 12, 2022 19:38
@Berlioz Berlioz merged commit 9941668 into launch.next Oct 12, 2022
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