Skip to content

Consider gracefully recovering from erroneous use of 'unchecked' in operator declaration #60394

@AlekseyTs

Description

@AlekseyTs
class C0 
{
    public static C0 operator unchecked -(C0 x)
    {
        return x;
    }
    public static C0 operator unchecked -(C0 x, C0 y)
    {
        return x;
    }
    public static explicit operator unchecked long(C0 x)
    {
        return 0;
    }
}

Only checked keyword is allowed at that position.

Relates to test plan #59458

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions