Incorrect expansion if you cast in the switch
mglidden opened this issue · comments
Mason Glidden commented
If you have to cast your int into an enum, SCXcodeSwitchExpander will expand the case statements incorrectly. If you type "(Test)test" in that order, it won't do anything. If you type "test" and then go back and add the cast, it will expand out into this red, green, blue, alpha cases.
typedef NS_ENUM(NSInteger, Test) {
TestOptionOne = 0,
TestOptionTwo,
};
@interface TestClass : NSObject
@end
@implementation TestClass
- (void)testMethod:(NSInteger)test {
switch ((Test)test) {
case red:
<#statement#>
break;
case green:
<#statement#>
break;
case blue:
<#statement#>
break;
case alpha:
<#statement#>
break;
}
}
@end
Stefan Ceriu commented
Heh, does a similar thing for me using and enum from SCStackViewController.
Thank you for raising it, I'll try to figure out what wrong and fix it this week.
Stefan Ceriu commented
Should be okay now, but please do let me know if you encounter any more issues.