Current code uses nullable smart pointers for some stuff that is never null. This is perfectly fine, but a bit confusing:
- When reading the code, it is not clear which pointer is nullable or never null.
- Pointers that are never null still have confusing null checks (with possible error handling return branches), which are always dead in coverage reports or when applying mutation testing.
- While some places have the redundant null checks on pointers that are never null, other places do not, which adds to the confusion.
Clarify this at compile-time by using NotNull (or a plain reference)