Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

VB -> C#: Error compiling Linq with early Select #736

Closed
jhony1104 opened this issue Jul 1, 2021 · 2 comments
Closed

VB -> C#: Error compiling Linq with early Select #736

jhony1104 opened this issue Jul 1, 2021 · 2 comments
Labels
output logic error A bug where the converted output behaves differently to the input code VB -> C# Specific to VB -> C# conversion

Comments

@jhony1104
Copy link

VB.Net input code

Dim query = From t in Test
            Select t.foo
            Where t.Id = 123

Erroneous output

var query = from t in Test
            select t.foo;

Expected output

var query = from t in Test
            where t.Id = 123
            select t.foo;

Details

  • Product in use: codeconverter.icsharpcode.net and VS extension
  • Version in use: current codeconverter.icsharpcode.net
  • Did you see it working in a previous version, which? no (first time user)
@jhony1104 jhony1104 added the VB -> C# Specific to VB -> C# conversion label Jul 1, 2021
@jhony1104 jhony1104 changed the title VB -> C#: Stops parsing Linq at early Select VB -> C#: Error compiling Linq with early Select Jul 1, 2021
@GrahamTheCoder
Copy link
Member

Thanks for the report. I hadn't realised that Where could come after Select.

@GrahamTheCoder GrahamTheCoder added the output logic error A bug where the converted output behaves differently to the input code label Jul 2, 2021
@GrahamTheCoder
Copy link
Member

I couldn't get your example to compile because t is out of scope after the Select, but if I replace it with a valid condition I can repro 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
output logic error A bug where the converted output behaves differently to the input code VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

2 participants