A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/5050 below:

[java] Problems with pattern variables in switch branches · Issue #5050 · pmd/pmd · GitHub

It seems there is an issue with the scope of pattern variables in switch branches. In the following, the variable array is undefined in the RHS of the branch:

return switch (foo) {
	case char[] array -> new String(array);
	case String string -> string;
	default -> throw new Exception();
};

Originally posted by @boris-petrov in #4874 (comment)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4