Skip to content

Obsolete members are not reported for implicit range indexer #53418

@alrz

Description

@alrz

Version Used: main

Steps to Reproduce:

public class C {
    [Obsolete("error", error: true)]
    public int Slice(int i, int j) => 0;
    [Obsolete("error", error: true)]
    public int this[int i] => 0;
    [Obsolete("error", error: true)]
    public int Count => 0;
    public void M() {
        _ = this[^1]; // no error
        _ = this[..]; // no error
    }
}

Expected Behavior: Error on both usages

Actual Behavior: No error

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions