Skip to content

Change package:vm_service BoundVariable.value from "dynamic" to "Response" #51930

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
DanTup opened this issue Apr 3, 2023 · 2 comments
Open
Assignees
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. pkg-vm-service

Comments

@DanTup
Copy link
Collaborator

DanTup commented Apr 3, 2023

Noted at #51916 (comment). The current type of BoundVariable.value is dynamic:

/// [value] can be one of [InstanceRef], [TypeArgumentsRef] or [Sentinel].
dynamic value;

All of the types it can be implement/extend Response so this could be Response.

The problem with dynamic is that it's easy to pass to any function and get a runtime error (which is what #51916 was, assuming it was always InstanceRef).

@bkonyi notes this code is generated so might not be trivial to know the types all share a common base.

@bkonyi bkonyi added the area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. label Apr 3, 2023
@bkonyi
Copy link
Contributor

bkonyi commented Apr 3, 2023

FYI @derekxu16. This isn't high priority, but we'll probably want to do a breaking release at some point to make this change. It'd probably be sufficient to change all of our instances of dynamic in vm_service classes to Object to avoid having to figure out the common base class of each type in a union.

@DanTup
Copy link
Collaborator Author

DanTup commented Apr 3, 2023

It'd probably be sufficient to change all of our instances of dynamic in vm_service classes to Object

Yeah, that sounds like a much simpler change and would've also prevented the issue I hit :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. pkg-vm-service
Projects
None yet
Development

No branches or pull requests

3 participants