This flips the switch to have @noescape be the default semantics for
function types in argument positions, for everything except property
setters. Property setters are naturally escaping, so they keep their
escaping-by-default behavior.
Adds contentual printing, and updates the test cases.
There is some further (non-source-breaking) work to be done for
SE-0103:
- We need the withoutActuallyEscaping function
- Improve diagnostics and QoI to at least @noescape's standards
- Deprecate / drop @noescape, right now we allow it
- Update internal code completion printing to be contextual
- Add more tests to explore tricky corner cases
- Small regressions in fixits in attr/attr_availability.swift
These are very useful fixits for migration. Note: this applies the
fixits for selectors that are actually found, but not the one that wraps
an arbitrary string literal in Selector(...), because that one indicates
a possibly missing selector that the user should review.
rdar://problem/26678232
Seeing Module<Args> is more likely to indicate some catastrophic
failure, for instance a missing type with the same name as the module,
than that we should remove the generic arguments.
rdar://problem/26639477
Like this:
MyEnumType(MyEnumType.foo)
This is missing 'rawValue:' label, but that won't actually fix this. A better fix is to just remove the unnecessary constructor call:
MyEnumType(MyEnumType.foo)
-->
MyEnumType.foo
Adds fixits for:
- Passing an integer with the right type but which is getting wrapped with a
different integer type unnecessarily. The fixit removes the cast.
- Passing an integer but expecting different integer type. The fixit adds
a wrapping cast.
If the expression type is RawRepresentable with an associated
RawValue type of T, and the contextual type is T, suggest adding
a '.rawValue' accessor call.
Also, suggest inserting the fixit in a few more cases, such as
dictionary keys.
This improves upon a previous patch which added a fix-it for the
other direction:
<55bf215feb>
Fixes <rdar://problem/26470490>.
These interact badly with the swift migrator, they are triggered by label mismatches in pre-migrated code.
We also don't generally need them since we do inference for the most common cases.
is used by precisely one thing (producing a warning in a scenario that is obsolete
because we deprecated the entire thing), so the complexity isn't worth it anymore.
These APIs are from the Swift 1.2 => Swift 2.0 transition, and are not
relevant anymore.
Removing them reduces the surface area of the library that needs to be
reviewed.
Now that we are using OptionSetType for option sets, all the support for
doing things the old way can die.
Note: the fix-it that used to apply to RawOptionSetType, it seemed to me,
should still apply to OptionSetType, so I switched it over instead of
removing it.
Swift SVN r29066
The primary motivation is to address SDK change of a common API.
The diagnostic checks return statements per advice from JoeP to simplify implementation.
rdar://21034343
Swift SVN r28826
Adding a bang can be unsafe and may lead to silently adding crashes in user's code.
Err on the side of caution and let the compiler error stand so the user can review the code.
Swift SVN r28467