switch expression: display dedicated error on target type void (IDEA-203776)

This commit is contained in:
Anna.Kozlova
2018-12-07 20:13:41 +01:00
parent 9eee56e6b1
commit 6692c339e1
2 changed files with 8 additions and 0 deletions
@@ -103,5 +103,9 @@ no instance(s) of type variable(s) exist so that Integer conforms to String">()
};
}
};
Runnable r = () -> <error descr="Target type for switch expression cannot be void">switch</error>(0) {
default -> throw new IllegalArgumentException();
};
}
}