Support out and ref dynamic for more types than just object and dynamic #2263
Unanswered
YairHalberstadt
asked this question in
Language Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently dynamic will fail at runtime for cases like these:
This is because like all ref calls, the type of the argument must exactly match the type of the parameter.
Currently there is no obvious way around this that I can think of if the types are not known at compile time.
As such, if there is a reasonable way around this using reflection, I think it would be super useful to encapsulate this in dynamic.
For a case where this is causing issues, see this issue in Roslyn: dotnet/roslyn#32709
Beta Was this translation helpful? Give feedback.
All reactions