That isn't going to work. The way I would approach "polyfills" would be to have the compiler support emitting copies of the definitions into binaries, that can be overridden by the definitions in the OS on newer platforms. We already do this in the standard library to make new APIs backward-deployable where possible, and we're investigating ways to enable it for other things like types and protocol conformances. For example, see Backwards-deployable Conformances.
5 Likes