Skip to content

Commit

Permalink
Silence unchecked cast warning.
Browse files Browse the repository at this point in the history
Technically, we had been assuming the root pointer's type was
Bosk<R>.RootRef, while it's actually only known to be
Bosk<?>.RootRef.
  • Loading branch information
prdoyle committed Nov 17, 2023
1 parent 331f3d3 commit b6f6d0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bosk-core/src/main/java/io/vena/bosk/Bosk.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.val;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
Expand Down Expand Up @@ -289,7 +290,7 @@ private <T> void assertCorrectBosk(Reference<T> target) {
// On the other hand, there's a certain symmetry to requiring the references to have the right
// bosk for both reads and writes, and forcing this discipline on users might help them avoid
// some pretty confusing mistakes.
assert ((RootRef) target.root()).bosk() == Bosk.this: "Reference supplied to driver operation must refer to the correct bosk";
assert ((Bosk<?>.RootRef)target.root()).bosk() == Bosk.this: "Reference supplied to driver operation must refer to the correct bosk";
}

/**
Expand Down

0 comments on commit b6f6d0b

Please sign in to comment.