Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 883 Bytes

File metadata and controls

49 lines (39 loc) · 883 Bytes

AC0008 Not defined operator type

Not defined Operator type.

Examples of patterns that are flagged by this analyzer

class Program {
    static Main() {
        _ = new LazySegtree<int, int, OpLazy>(1);
    }
}

Solution

Define Operator type.

class Program {
    static Main() {
        _ = new LazySegtree<int, int, OpLazy>(1);
    }
}
struct OpLazy : ILazySegtreeOperator<int, int>
{
    public int Identity => default;

    public int FIdentity => default;

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int Composition(int f, int g)
    {
        return default;
    }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int Mapping(int f, int x)
    {
        return default;
    }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int Operate(int x, int y)
    {
        return default;
    }
}