-
Notifications
You must be signed in to change notification settings - Fork 323
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
State accepts only Type as key - explain in docs #7572
Comments
JaroslavTulach
changed the title
Methods manipulating with State accept only Type as key
State accepts only Type as key - explain in docs
Aug 13, 2023
Can we make it so that the methods throw and error if the key is not a type object. |
2 tasks
Jaroslav Tulach reports a new STANDUP for yesterday (2023-08-15): Progress: -
Next Day: Towards Python Interop & TCK |
github-project-automation
bot
moved this from 👁️ Code review
to 🟢 Accepted
in Issues Board
Aug 16, 2023
Jaroslav Tulach reports a new STANDUP for yesterday (2023-08-16): Progress: - review
Next Day: Towards Python Interop & TCK
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code fails on
Uninitialized_State
panic:This is because in both cases
"my_state"
is a different instance ofText
and we do not haveequals
method implemented onText
. See the javadoc ofDynamicObjectLibrary
:Putting types as keys works because types are singletons. So the following works:
Ideally, we should compare keys with
EqualsNode
, at least on the slow path. Or update the documentation ofState
methods.The text was updated successfully, but these errors were encountered: