Skip to content

Incorrect expansion if you cast in the switch #12

Closed
@mglidden

Description

@mglidden

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions