mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user