-
Notifications
You must be signed in to change notification settings - Fork 213
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
Conversation
src/params/types.ts
Outdated
return this.runtimeValue(); | ||
} | ||
|
||
// @internal |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
runtimeValue(): T { | ||
return this.test.runtimeValue() ? valueOf(this.ifTrue) : valueOf(this.ifFalse); |
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
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()
Co-authored-by: Daniel Lee <[email protected]>
8bfbb09
to
bf724c4
Compare
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.