If you write a plugin that contains a fir checker ...
# compiler
h
If you write a plugin that contains a fir checker (eg a function needs to be static) and a IR part, do you also recheck the condition in the IR?
j
I don't think it is necessary, as the compilation will fail before IR is executed
1
🙏 1
h
Yeah, I also want to avoid it (and I am lazy too), but isn't it possible that another plugin creates another functions (my use-case) without being validated by my fir plugin?
Copy code
myFirPlugin
anotherFirPlugin
myIrPlugin
j
If you cannot control the order in which the plugin is applied, I think you can have that problem then. There is a youtrack issue about ordering but I don't have it at a hand
h
Well, on the other hand, if another plugin creates an invalid function, it is its responsibility to create a valid function. So I will be lazy and remove the IR checks. (at least for my use-case I require an annotated function so it is easy to blame).
👍 1
1
d
Declarations, generated by plugins are not checked by checkers, as they don't belong to the main FIR forest (with
FirFile
as roots) At IR level you can check the declaration origin to determine if it came from some other plugin or from sources (so you can blame that plugin correctly)
🙏 2