Introduce the notion of factory initializers.

Factory initializers express an initializer that produces an object of
the given type, but is not inherited and not designated. Although they
have a syntactic form for presentation purposes (-> ClassName), there
is no way to specify or implement them within Swift. Rather, factory
initializers are created when importing an Objective-C factory method
that returns the class type rather than instancetype.

Swift SVN r16528
This commit is contained in:
Doug Gregor
2014-04-18 16:04:48 +00:00
parent d80b689c51
commit 812dc091eb
6 changed files with 61 additions and 6 deletions

View File

@@ -1300,6 +1300,9 @@ getStableCtorInitializerKind(swift::CtorInitializerKind K){
case swift::CtorInitializerKind::ConvenienceFactory:
llvm_unreachable("Convenience factory initializers cannot be uttered");
case swift::CtorInitializerKind::Factory:
llvm_unreachable("Factory initializers cannot be uttered");
#define CASE(NAME) \
case swift::CtorInitializerKind::NAME: return serialization::NAME;
CASE(Designated)