Using module variables as dimensions in function arguments

Yes, they are classical explicit-shape. Why cannot the compiler check anything?