如何在编译时快速使用#error引发错误

I want to throw an error in the condition in compile time. but #error throw an error immediately.

这是我的尝试:

var number: Int = 10 
if number < 20 {
   #error("the number is smaller than 20")

}

但这行不通!

评论