Commit Graph

8 Commits

Author SHA1 Message Date
Doug Gregor
56443538e9 Clang importer: hammer over inconsistencies between property/getter/setter optionality.
When an imported Objective-C property has nullability, force that
nullability onto the result of its getter and the parameter of its
setter, so that we have consisteny nullability among the three. SILGen
assumes that this is the case, so this fixes the null_resettable-based
crash in <rdar://problem/20145910>.

Swift SVN r26198
2015-03-17 00:03:33 +00:00
Doug Gregor
c362f5962d Add a test for the weird form of __attribute__((nonnull(indices...))).
Test from rdar://problem/19522038, which is actually about something
entirely different.

Swift SVN r24751
2015-01-27 17:06:46 +00:00
Doug Gregor
f0eec4d9d5 Don't rely on overriding nullability in Objective-C; it's banned now.
Fixes rdar://problem/19610107.

Swift SVN r24750
2015-01-27 16:52:03 +00:00
Doug Gregor
69e5a3ddda Clean up handling of nullability in the Clang importer.
Handle nullability at the top level of importType, so that it doesn't
break bridging.

Swift SVN r24195
2015-01-06 00:16:38 +00:00
Doug Gregor
671f79483a Properly account for nullability of Objective-C methods with a related result type.
We were losing the nullability of factory methods that turned into
initializers (which should have been mapped to failability), and more
generally, methods with nullability for related result types
(instancetype in Clang, dynamic Self in Swift).

Note that this commit also contains tests for a similar Clang-side fix
where Clang itself wasn't correctly recording that an Objective-C
method with a nullability-qualified instancetype result type in fact
had a related result type.

Found by browsing through the most excellent Swift SDK Analyzer.

Swift SVN r23834
2014-12-10 06:20:23 +00:00
Doug Gregor
5524c0a393 Honor the Clang nonnull and returns_nonnull attributes in the importer.
Non-null attributes can indicate non-optionality of pointers. While
these non-null attributes are generally less useful than the
nullability type specifiers, they are occasionally used in the
wild. Addresses rdar://problem/18428099.

Swift SVN r23733
2014-12-05 06:58:54 +00:00
Doug Gregor
7b77294cac Improve testing of nullability type specifier importing.
Swift SVN r23457
2014-11-20 00:06:14 +00:00
Doug Gregor
9d9336db97 Importer nullability type specifiers __nonnull/__nullable/__null_unspecified as optional types.
Implements rdar://problem/19005653.

Swift SVN r23416
2014-11-18 23:23:21 +00:00