LambdaS5 icon indicating copy to clipboard operation
LambdaS5 copied to clipboard

Code duplication in desugaring of switch statements

Open tilk opened this issue 10 years ago • 0 comments

The code in cases after the default case is duplicated, which can lead to exponential blowup. For example, in this code:

switch(1) {
  default:
  case 1: 
  switch(1) { 
    default:
    case 1:
    x = 1
  }
}

The x = 1 statement is replicated four times in the desugared code.

tilk avatar Feb 06 '15 16:02 tilk