Found a bug?

David Alayachew davidalayachew at gmail.com
Sat Jul 15 03:45:18 UTC 2023


And if I replace that snippet with this, I get the expected and desirable
compiler error "didn't cover all switch cases" (referring to the parent
switch where that statement is actually true).


   public List<Symbol> stateTransitions(final InternalState internalState)
   {

      return
         switch (this)
         {

            case C         -> ADD_SYMBOLS.apply(List.of(NUMBER,
SUB_STATE_OPERATOR), List.of());
            case CE        -> ADD_SYMBOLS.apply(List.of(NUMBER,
SUB_STATE_OPERATOR), List.of(C));
            case BACKSPACE -> switch (internalState)
                              {

                                 case InternalState(_, ConsEmpty(), _, _,
_, _)  -> ADD_SYMBOLS.apply(List.of(NUMBER, SUB_STATE_OPERATOR), List.of(C,
CE));
                                 case InternalState is
      -> ADD_SYMBOLS.apply(List.of(NUMBER, SUB_STATE_OPERATOR,
SCREEN_OPERATOR), List.of());

                              };

         };

   }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230714/e35c7426/attachment-0001.htm>


More information about the amber-dev mailing list