1 // RUN: clang-refactor extract -selection=test:%s %s -- 2>&1 | grep -v CHECK | FileCheck %s
5 @property (strong) HasProperty *item;
7 - (HasProperty *)implicitProp;
9 - (void)setImplicitSetter:(HasProperty *)value;
13 @implementation HasProperty
15 - (void)allowGetterExtraction {
16 /*range allow_getter=->+0:42*/self.item;
17 /*range allow_imp_getter=->+0:54*/self.implicitProp;
19 // CHECK: 1 'allow_getter' results:
20 // CHECK: extracted() {
21 // CHECK-NEXT: return self.item;{{$}}
22 // CHECK-NEXT: }{{[[:space:]].*}}
23 // CHECK-NEXT: - (void)allowGetterExtraction {
24 // CHECK-NEXT: extracted();
26 // CHECK: 1 'allow_imp_getter' results:
27 // CHECK: extracted() {
28 // CHECK-NEXT: return self.implicitProp;{{$}}
29 // CHECK-NEXT: }{{[[:space:]].*}}
30 // CHECK-NEXT: - (void)allowGetterExtraction {
31 // CHECK-NEXT: self.item;
32 // CHECK-NEXT: extracted();
34 - (void)prohibitSetterExtraction {
35 /*range prohibit_setter=->+0:45*/self.item = 0;
36 /*range prohibit_setter=->+0:55*/self.implicitSetter = 0;
38 // CHECK: 2 'prohibit_setter' results:
39 // CHECK: the selected expression can't be extracted