[linters] Improve to_string method for boxed values

Reviewed By: martinoluca

Differential Revision: D5536511

fbshipit-source-id: 42e80cc
master
Dulma Churchill 7 years ago committed by Facebook Github Bot
parent d0858c7770
commit 00c1b354e1

@ -73,6 +73,11 @@ let rec ast_node_name an =
-> s
| Stmt ObjCStringLiteral (_, [stmt], _)
-> "@" ^ ast_node_name (Stmt stmt)
| Stmt ObjCBoxedExpr (_, [stmt], _, objc_boxed_expr_info)
-> let selector =
match objc_boxed_expr_info.obei_boxing_method with Some sel -> sel | None -> ""
in
selector ^ ast_node_name (Stmt stmt)
| _
-> ""

@ -62,4 +62,11 @@ typedef NS_ENUM(NSUInteger, MyEnum) {
[self enum_param:@"s"];
}
- (void)param_int:(int)s {
}
- (void)call_with_boxed_int {
[self param_int:@0];
}
@end

@ -23,6 +23,7 @@ codetoanalyze/objc/linters/badpointer.m, bad6, 106, BAD_POINTER_COMPARISON, []
codetoanalyze/objc/linters/badpointer.m, bad7, 121, BAD_POINTER_COMPARISON, []
codetoanalyze/objc/linters/badpointer.m, bad8, 128, BAD_POINTER_COMPARISON, []
codetoanalyze/objc/linters/badpointer.m, bad9, 135, BAD_POINTER_COMPARISON, []
codetoanalyze/objc/linters/implicit_cast.m, Implicit_cast_call_with_boxed_int, 69, POINTER_TO_INTEGRAL_IMPLICIT_CAST, []
codetoanalyze/objc/linters/implicit_cast.m, Implicit_cast_call_with_string, 62, POINTER_TO_INTEGRAL_IMPLICIT_CAST, []
codetoanalyze/objc/linters/implicit_cast.m, Implicit_cast_ivar_dictionary_item_call_funct_with_int, 47, POINTER_TO_INTEGRAL_IMPLICIT_CAST, []
codetoanalyze/objc/linters/implicit_cast.m, Implicit_cast_property_with_int, 51, POINTER_TO_INTEGRAL_IMPLICIT_CAST, []

Loading…
Cancel
Save