mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ClangImporter] Add an option (off by default) to infer "implicit properties".
In Objective-C, any method with no arguments can be used with dot syntax, as can any method that takes one argument whose name starts with "set". This commit adds a frontend-only flag -enable-objc-implicit-properties to look for "setter-like" methods that match up with "getter-like" methods to import them as Swift properties. By default, such methods are just considered unrelated methods. Part of <rdar://problem/16215476> Swift SVN r16025
This commit is contained in:
@@ -560,6 +560,9 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts, ArgList &Args,
|
||||
Opts.ExtraArgs.push_back(A->getValue());
|
||||
}
|
||||
|
||||
Opts.InferImplicitProperties =
|
||||
Args.hasArg(OPT_enable_objc_implicit_properties);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user