[swift-evolution] Proposal: Allow functions to participate in the compile so they can generate warnings about their usage.
a.michail at me.com
Fri Feb 12 17:15:11 CST 2016
For example, the Swift standard library might want to ensure that you use "preconditionFailure()" instead of "precondition(false)" since the former doesn’t get in the way of constant/variable initialization static analysis.
So maybe allow functions to have a warning clause with an abstract syntax tree parameter allowing the function to examine its usage context in the source code and issue warnings correspondingly that appear during the compile.
Here’s some related work: https://msdn.microsoft.com/en-us/magazine/dn879356.aspx <https://msdn.microsoft.com/en-us/magazine/dn879356.aspx>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution