immutables icon indicating copy to clipboard operation
immutables copied to clipboard

Value.Check not propagating to immutable interface subclasses

Open csolidum opened this issue 10 months ago • 0 comments

I have a immutable interface that extends another interface. The base interface has the @Value.Check annotation on a function. I would expect that the ImmutableSubclass would call the annotated function, that's not happening in practice. Is it expected that subinterfaces respect the @Value.Check annotation.

    interface A {
        @Value.Check
        @Value.NonAttribute
        void check();
    }

    @Value.Immutable
    interface B extends A {
        @Override
        default void check() {
            throw new IllegalStateException();
        }
    }

In the above example, I would expect ImmutableB.builder.build() would throw an exception, but its not.

csolidum avatar May 22 '25 23:05 csolidum