[componentkit][test] typedef struct -> class

Reviewed By: dulmarod

Differential Revision: D3909628

fbshipit-source-id: 52e9539
master
Ryan Rhee 9 years ago committed by Facebook Github Bot 6
parent f54b84c751
commit d2ac2242c4

@ -72,16 +72,19 @@
} }
@end @end
typedef struct { int a; } BarStruct; class BarClass {
public:
int a;
};
@interface BarComponent : CKCompositeComponent @interface BarComponent : CKCompositeComponent
@end @end
@implementation BarComponent @implementation BarComponent
+ (instancetype) new { + (instancetype) new {
// C++ structs // C++ classes
BarStruct s1; // error BarClass s1; // error
const BarStruct& s2 = s1; // no error const BarClass& s2 = s1; // no error
BarStruct& s3 = s1; // error BarClass& s3 = s1; // error
const BarStruct s4 = {.a = 3}; // no error const BarClass s4 = {.a = 3}; // no error
} }
@end @end

@ -1,5 +1,5 @@
componentkit/Test.mm, BarComponent_new, 82, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE componentkit/Test.mm, BarComponent_new, 85, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE
componentkit/Test.mm, BarComponent_new, 84, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE componentkit/Test.mm, BarComponent_new, 87, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE
componentkit/Test.mm, FooComponent_newWithString:, 48, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE componentkit/Test.mm, FooComponent_newWithString:, 48, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE
componentkit/Test.mm, FooComponent_newWithString:, 53, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE componentkit/Test.mm, FooComponent_newWithString:, 53, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE
componentkit/Test.mm, FooComponent_newWithString:, 55, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE componentkit/Test.mm, FooComponent_newWithString:, 55, MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE

Loading…
Cancel
Save