Thinking more about this, I've just realised what the obvious thing I'm missing here is: my project uses source code from the package, which is tested with its tests - duh!
Blindingly obvious to myself now why I'm getting the compile error. Sorry about that, Carl.