Compiler Version Directive

@hartbit, I'm also a bit confused about this. I've read the draft proposal; the previous topic; and the blog post.

Your table of Compiler Invocations is incomplete, because there will be a -swift-version 4.2 (Basic/Version.h, Basic/Version.cpp). And the compiler directive version for Swift 3.1 ... 4.1 should be empty.

Your example of conditionally using compactMap or flatMap might be unnecessary, because the old APIs are only deprecated since version 4.1 (SR-6970). And as @pvieito points out, if the standard library eventually becomes a system library (or framework), then would this need to be a run-time condition?

Instead of introducing a new #if compiler(...) directive, could this proposal update the existing #if swift(...) directive, by adding argument labels?