Commit Graph

3 Commits

Author SHA1 Message Date
Saleem Abdulrasool
fa93d89cfb ClangImporter: use intptr_t instead of long
`long` is imported as `Int32` on LLP64, and `Int` on LP64.  Use
`intptr_t` instead which is always imported as `Int`.  This fixes the
clang-importer.objc_missing_designated_init test.
2019-03-28 17:34:56 -07:00
Jordan Rose
a19cf7b183 Allow designated initializers outside the ClassDecl
Objective-C allows this in "class extensions" (nameless categories);
what's worse is that it's actually useful-ish sometimes: when you want
to put a particular initializer in an explicit submodule, or only
expose it to the current target.

rdar://problem/37173549
2018-03-19 16:36:40 -07:00
Jordan Rose
7397340ca8 Don't inherit convenience inits if a designated init is missing. (#8708)
(which can happen if an imported class has un-importable initializers)

Our initializer model guarantees that it's safe to inherit convenience
initializers when a subclass has implemented all designated
initializers, since each convenience initializer will be implemented
by calling one of the designated initializers. If one of the
designated initializers /can't/ be implemented in Swift, however,
then inheriting the convenience initializer would not be safe.

This is potentially a source-breaking change, so the importer will
only actually record that it failed to import something in when
compiling in Swift 4 mode.

rdar://problem/31563662
2017-04-24 11:47:54 -07:00