Skip to content
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

[http-client-csharp] Strong typed snippet methods #3312

Open
ArcturusZhang opened this issue May 10, 2024 · 0 comments · May be fixed by #3223
Open

[http-client-csharp] Strong typed snippet methods #3312

ArcturusZhang opened this issue May 10, 2024 · 0 comments · May be fixed by #3223
Assignees

Comments

@ArcturusZhang
Copy link
Member

ArcturusZhang commented May 10, 2024

We have some methods with semantic meanings to construct a statement, such as

public static MethodBodyStatement Declare(string name, TypedValueExpression value, out TypedValueExpression variable)

this loses its type information, for instance, when I put a StreamExpression as value, we only get a TypedValueExpression as the variable.

If possible, we could introduce a generic version of this method, such as

public static MethodBodyStatement Declare<T>(string name, T value, out T variable) where T : TypedValueExpression

therefore we could get this usage:

Declare("stream", streamExpression, out StreamExpression streamVar);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant