Noop for Swift's Exhaustive Switch Statements

后端 未结 5 1627
有刺的猬
有刺的猬 2020-11-30 07:17

Swift requires exhaustive switch statements, and that each case have executable code.

\'case\' label in a \'switch\' should have at least one executable

5条回答
  •  [愿得一人]
    2020-11-30 07:57

    Below is one option for null statement, but maybe not a good solution. I cannot find a statement like python pass

    {}() 
    

    for switch case, break is better choice.

    break
    

提交回复
热议问题