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

using declaration is not parsed correctly wants ";", using statement (block form) works fine. #75444

Open
johngardner58work opened this issue Oct 8, 2024 · 0 comments
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@johngardner58work
Copy link

johngardner58work commented Oct 8, 2024

Compiler version: '4.8.0-7.23558.1 (e091728)'. Language version: 12.0.
The following does not work in donet interactive which uses Roslyn

if (...) // **does not work**
{ 
   using FileStream f = new FileStream(@"C:\users\jaredpar\using.md");
   // statements
}

// Equivalent to (but not in Rosyln)  this form works **fine** 
if (...) 
{ 
   using (FileStream f = new FileStream(@"C:\users\jaredpar\using.md")) 
   {
    // statements
   }
}

Expected Behavior: using declaration form should compile the same as the block form

Actual Behavior:
Error: (39,22): error CS1002: ; expected
(53,46): error CS1525: Invalid expression term ')'

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants