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

Quick assist "Join if statement with inner if" drops comments #1853

Open
srikanth-sankaran opened this issue Dec 14, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@srikanth-sankaran
Copy link

This block of code:

        if ((this.bits & ASTNode.SwitchRuleBlock) != 0) { // switch rule blocks shouldn't fall through ...
		if (flowInfo != FlowInfo.DEAD_END) {
			if (flowContext.associatedNode instanceof SwitchExpression) { // ... demand that for expression switch
				currentScope.problemReporter().switchExpressionBlockCompletesNormally(this);
			} else { // ... enforce that for statement switch, by an automagic break
				flowContext.recordBreakFrom(flowInfo);
				return FlowInfo.DEAD_END;
			}
		}
	}

becomes this:

        if ((this.bits & ASTNode.SwitchRuleBlock) != 0 && flowInfo != FlowInfo.DEAD_END) {
		if (flowContext.associatedNode instanceof SwitchExpression) { // ... demand that for expression switch
			currentScope.problemReporter().switchExpressionBlockCompletesNormally(this);
		} else { // ... enforce that for statement switch, by an automagic break
			flowContext.recordBreakFrom(flowInfo);
			return FlowInfo.DEAD_END;
		}
	}

See that the original comment // switch rule blocks shouldn't fall through ... has vanished

@jjohnstn jjohnstn self-assigned this Dec 14, 2024
@jjohnstn jjohnstn added the bug Something isn't working label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants