Commit Graph

5 Commits

Author SHA1 Message Date
Alex Lorenz
b60d635db7 [interop] make interop diagnostics more consistent with the rest of Swift diagnostics 2023-04-10 16:20:07 -07:00
Daniel Rodríguez Troitiño
92652c6c95 [ClangImporter] Supporting changes towards structs with ARC pointers (#59594)
In order to allow supporting `__strong` (and `__weak`) struct fields,
some parts of the ClangImporter needs to understand them. The changes in
this commit allows the type importer to allow the already supported
`__unsafe_unretained` struct fields, but still reject the `__strong` and
`__weak` fields. Later changes will add support for bridging `__strong`
and `__weak` fields.

All the code should be equivalent to the previous code, and since all
the structs with non-trivial copy/destroy are completely discarded, the
code should not even be hit in any case.

The included modifications in the tests check that the error and the
diagnostics note are produced correctly.
2023-02-03 12:00:16 -08:00
Saleem Abdulrasool
bdb7901a1c test: modernise nullability attributes (NFC)
Use the modern spelling for the nullability attributes in the test mock
headers.  Currently, this was relying on the predefined macros from
clang to work.  However, those are only available on Darwin targets.
This is needed to make the mock environments more portable.
2017-11-01 23:27:33 -07:00
Jordan Rose
557f70ca4a [ClangImporter] Import __unsafe_unretained struct fields as Unmanaged.
We don't know if these fields are intended to reference objects at +0 or at +1,
so force the user to decide.

rdar://problem/19790608

Swift SVN r30080
2015-07-10 19:05:26 +00:00
Joe Groff
a0ecab5b16 ClangImporter: Don't attempt to bridge __unsafe_unretained NSString * fields in structs.
We certainly can't import them as stored properties, and it's too late to try to bridge them as computed property, so restore the old behavior of importing them as unbridged object types. The types still come in as strong managed reference types, which is still wrong, but seems to be right enough for Khan Academy and potentially other existing apps for now, and I don't want to introduce additional source-breaking changes and instability this late in the game. Fixes rdar://problem/19789023, leaving rdar://problem/19790608 to be done when we can afford more churn.

Swift SVN r25158
2015-02-11 01:30:20 +00:00