-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBugFeature - Simple ProgramsTop-level statementsTop-level statementshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Version Used:
master
Steps to Reproduce:
using System;
var student = new Student("Youssef"); // Apply the codefix
Console.WriteLine(student.Name);
Expected Behavior:
using System;
var student = new Student("Youssef");
Console.WriteLine(student.Name);
internal class Student
{
private string v;
public Student(string v)
{
this.v = v;
}
}
Actual Behavior:
using System;
var student = new Student("Youssef");
internal class Student
{
private string v;
public Student(string v)
{
this.v = v;
}
}
Console.WriteLine(student.Name);
error CS8803: Top-level statements must precede namespace and type declarations.
Note that the class declaration must come after all top-level statements, but the codefix currently puts it in between statements.
This might not be specific to this codefix, but an issue in the code generation process that's used by more than one analyzer
svick
Metadata
Metadata
Assignees
Labels
Area-IDEBugFeature - Simple ProgramsTop-level statementsTop-level statementshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Type
Projects
Status
Completed