loading...

re: Is “Defensive Programming” actually healthy? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: That is a work around. But no, the compiler won't tell you. An exception will tell you at runtime. Assuming you tested correctly you may find this...

Try compiling this code. The compiler will in fact tell you if you’re missing a case that’s described in the discriminated union.

Of course, that only works if you recompile all your libraries and dependencies. The OO solution would work even if you only recompiled the class.

code of conduct - report abuse