As noted in the comments, a regex search can be created to catch most postfix uses ! . (And if you are careful, you should be able to ignore most uses of colon-typename-bang so you don't get noise from IUO declarations.)
This is about as good as it turns out, and itβs incomplete - for example, every time you call an API that returns an IUO type and accesses its result without checking the option, you can force a turnaround without explicitly having any errors in your code.
Any tool that tries to warn of unverified reversals in sequence should have a fairly thorough knowledge of rules such as Swift, grammar, and output types. Indeed, the only place where you can have such knowledge (and have it correctly) is inside the compiler. Thus, you are probably best off submitting an Apple feature request or working with an open source project .
source share