It didn’t work in your case because the OPEN_TYPE_LANGUAGES initialisation was at the file root level.
If you just put @setEvalBranchQuota() in a comptime block at the file root, it essentially doesn’t do anything; it won’t affect any of the initialisations in the file, because they’re not in that block.
Which is why putting the initialisation in a block is neccessary for @setEvalBranchQuota() to work on it.
This appears to sets branch quota on the sema object itself, which as the doc comment at the top of the file notes is shared between every block:
//! Semantic analysis of ZIR instructions.
//! Shared to every Block. Stored on the stack.
//! State used for compiling a ZIR into AIR.
//! Transforms untyped ZIR instructions into semantically-analyzed AIR instructions.
//! Does type checking, comptime control flow, and safety-check generation.
//! This is the the heart of the Zig compiler.
My reading is that this applies to anything semantically analyzed after the @setEvalBranchQuota call. So it’s guaranteed to apply to the rest of the current scope, and any child scopes, but may also apply elsewhere depending on top-level evaluation order.
I’m not particularly familiar with the compiler internals, so I could be wrong.