This diff exclude names containing queue from the strong delegate warning

Reviewed By: dulmarod

Differential Revision: D3093200

fb-gh-sync-id: 51c4f84
shipit-source-id: 51c4f84
master
Dino Distefano 9 years ago committed by Facebook Github Bot 2
parent 0c5bca7a4b
commit b7e93737df

@ -29,7 +29,7 @@ type warning_desc = {
(* Helper functions *) (* Helper functions *)
let property_name_contains_word pname word = let name_contains_word pname word =
let rexp = Str.regexp_string_case_fold word in let rexp = Str.regexp_string_case_fold word in
try try
Str.search_forward rexp pname.Clang_ast_t.ni_name 0 >= 0 Str.search_forward rexp pname.Clang_ast_t.ni_name 0 >= 0
@ -87,7 +87,8 @@ let dec_body_eventually atomic_pred param dec =
(* Strong Delegate Warning: a property with name delegate should not be declared strong *) (* Strong Delegate Warning: a property with name delegate should not be declared strong *)
let strong_delegate_warning decl_info pname obj_c_property_decl_info = let strong_delegate_warning decl_info pname obj_c_property_decl_info =
let condition = property_name_contains_word pname "delegate" let condition = (name_contains_word pname "delegate")
&& not (name_contains_word pname "queue")
&& ObjcProperty_decl.is_strong_property obj_c_property_decl_info in && ObjcProperty_decl.is_strong_property obj_c_property_decl_info in
if condition then if condition then
Some { name = "STRONG_DELEGATE_WARNING"; Some { name = "STRONG_DELEGATE_WARNING";

@ -24,6 +24,10 @@
@property(nonatomic, strong) id OneDelegateFile; @property(nonatomic, strong) id OneDelegateFile;
@property(nonatomic, strong) id OneDelegateQueue;
@property(nonatomic, strong) id OneQueueInTheMiddleDelegate;
@end @end
@implementation A { @implementation A {

Loading…
Cancel
Save