mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
44 KiB
44 KiB