C# preprocessor-like protection -
i wondering either possible create rule in c# inside code, prevent "compiling" , print error message of choice. example:
let's say:
- i have method takes argument bytes vector.
- inside method check what's length of byte vector.
- if it's long, short etc prevent program compiling , print error message in error list.
i know use assertion , stuff, working on compiled code.
i answer no because compiler (at compilation time) can't know value of parameter @ run time.
have nice day,
alberto
edit: check first comment question because it's more complete answer compared 1 :)
Comments
Post a Comment