-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringshelp 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:
16.0.0 Preview 3.0 28529.153.d16.0
Steps to Reproduce:
Enable unsafe compiler flag.
Run 'Convert to Method' on GetPtr local function.
class ClassA
{
public unsafe void UnsafeFunction()
{
byte b = 1;
unsafe byte* GetPtr(byte* bytePt)
{
return bytePt;
}
var aReference = GetPtr(&b);
}
}Expected Behavior:
New function should be marked as unsafe.
class ClassA
{
public unsafe void UnsafeFunction()
{
byte b = 1;
var aReference = GetPtr(&b);
}
private static unsafe byte* GetPtr(byte* bytePt)
{
return bytePt;
}
}Actual Behavior:
New method not marked as unsafe and shows compiler error.
class ClassA
{
public unsafe void UnsafeFunction()
{
byte b = 1;
var aReference = GetPtr(&b);
}
private static byte* GetPtr(byte* bytePt)
{
return bytePt;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsBuilt-in analyzers, fixes, and refactoringshelp 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
