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

VB -> C#: Conditional method calls with ByRef parameters #310

Open
mrmonday opened this issue May 5, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@mrmonday
Copy link
Contributor

commented May 5, 2019

Via #307.

Input code

If False AndAlso MethodWithByRef(MethodWithSideEffects()) Then
    DoSomething()
End If

Erroneous output

var arg = MethodWithSideEffects();
if (false && MethodWithByRef(ref arg))
{
    DoSomething();
}

Expected output

Unsure. Maybe something like:

Func<bool> arg = () => { var arg = MethodWithSideEffects(); MethodWithByRef(ref arg); };
if (false && arg())
{
    DoSomething();
}

@mrmonday mrmonday referenced this issue May 5, 2019

Merged

Support more complex ByRef arguments #307

2 of 2 tasks complete
@GrahamTheCoder

This comment has been minimized.

Copy link
Member

commented May 5, 2019

Yeah that's a bit like what happens for inline assignment for c# to vb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.