title: How exit from method in a switch expression?
body: <p>I'm studying switch expression, and I'd like to know how to pass control to the invoker method because &quot;yield&quot; just exits from the switch expression. I can't find any way to make it behave like the classic switch statement.</p>
  <p>Is it even possible?</p>
  <p>UPDATE: Here's a little piece of code.</p>
  <pre class="lang-java prettyprint-override"><code>public static boolean isTimeToParty(DayOfWeek day) {
      boolean isParty = switch (day) {
          case MONDAY -&gt; false;
          case TUESDAY -&gt; {
              yield false; //return not allowed
          }
          case WEDNESDAY -&gt; false;
          case THURSDAY -&gt; false;
          case FRIDAY -&gt; false;
          case SATURDAY -&gt; true;
          case SUNDAY -&gt; true;
      };
      return isParty;
  }
  </code></pre>
  <p>What I mean is: How to avoid assigning value to a variable and then calling return [variable_name]?
  I would like to return value and exit switch at the same time.</p>
  <p>Thanks in advance</p>