you can create a roselin analyser. it's a bit complex, but if you need your error at compile time, it's the best way to go