[swift-evolution] [Idea] #suppress(warning-identifier)
Russ Bishop
xenadu at gmail.com
Tue Mar 8 12:31:11 CST 2016
There are cases where I’d like to suppress a Swift compiler warning. Is there opposition to that idea from the core team or is it just something that hasn’t been looked at yet? (Forgive me if such a thing already exists and I just missed it)
My initial idea pre-bikeshedding:
#suppress(warning-identifier)
//some code
#unsuppress(warning-identifier)
The most common one I encounter is the trailing-closure syntax warning which can only be fixed by redesigning the API itself. I’ve also had to silence incorrect cast warnings (that are actually correct and execute just fine) by casting to Any first which is somewhat gross.
Russ
More information about the swift-evolution
mailing list