Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code duplication in desugaring of switch statements #54

Open
tilk opened this issue Feb 6, 2015 · 0 comments
Open

Code duplication in desugaring of switch statements #54

tilk opened this issue Feb 6, 2015 · 0 comments

Comments

@tilk
Copy link

tilk commented Feb 6, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant