Is there a pattern for doing module-level checkers...
# compiler
z
Is there a pattern for doing module-level checkers in FIR? I tried (ab)using
FirLanguageVersionSettingsChecker
as a hook and while it does report everything in the debugger, it doesn't appear to ever make it to the output diagnostics 🤔 . FIR diagnostic test infra reports no issues when I run the test, PR here: https://github.com/ZacSweers/metro/pull/2132
🤔 1
d
Diagnostics from
FirLanguageVersionSettingsChecker
are not supported properly in the test infrastructure unfortunately. It's on my todo list for a long time already, and I want to fix it after finishing currently ongoing tasks in the test infra (K1 tests removal and native tests implementation in the core test infra). As a workaround for now you can setup CLI tests for these specific diagnostics.
z
gotcha. So using those as a hook for whole-module checks would be sensible then? (test-infra notwithstanding)
d
It kinda depends. If you want to check something over the whole resolved module, it's better to do it at IR stage, as you actually have access to the whole module. But if you want to report something about incorrect configuration it's a good place.
👍 1