-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersBugFeature - RangeRangeRangeResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented
Milestone
Description
class C
{
public Buffer10 F = new Buffer10();
}
class Program
{
static void Main()
{
M2().F[^1] = 123;
}
static C M2() => new C() { F = {[^1] = 111} }; // error CS1913: Member '[^1]' cannot be initialized. It is not a field or property.
}
struct Buffer10
{
private int[] _array = new int[10];
public Buffer10()
{}
public int Length => 10;
public int this[int x]
{
get => _array[x];
set { _array[x] = value; }
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersBugFeature - RangeRangeRangeResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented