Files
swift-mirror/lib/Frontend/CompilerInvocation.cpp
Doug Gregor 44b8d45288 Clean up inference of default arguments from imported APIs (mostly).
My temporary hackery around inferring default arguments from imported
APIs was too horrible. Make it slightly more sane by:

1) Actually marking these as default arguments in the type system,
rather than doing everything outside of the type system. This is a
step closer to what we would really do, if we go in this
direction. Put it behind the new -frontend flag
-enable-infer-default-arguments.

2) Only inferring a default argument from option sets and from
explicitly "nullable" parameters, as stated in the (Objective-)C API
or API notes. This eliminates a pile of spurious, non-sensical "=
nil"'s in the resulting output.

Note that there is one ugly tweak to the overloading rules to prefer
declarations with fewer defaulted arguments. This is a bad
implementation of what is probably a reasonable rule (prefer to bind
fewer default arguments), which intentionally only kicks in when we're
dealing with imported APIs that have default arguments.

Swift SVN r32078
2015-09-18 21:50:59 +00:00

44 KiB