Found a bug?

Angelos Bimpoudis angelos.bimpoudis at oracle.com
Mon Jul 17 09:28:17 UTC 2023


Hey David,

I minimized and filed it here: https://bugs.openjdk.org/browse/JDK-8312163

Thanks for the analysis, David!


________________________________
From: amber-dev <amber-dev-retn at openjdk.org> on behalf of David Alayachew <davidalayachew at gmail.com>
Sent: 15 July 2023 05:45
To: amber-dev <amber-dev at openjdk.org>
Subject: Re: Found a bug?

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/20230717/c23afe24/attachment.htm>


More information about the amber-dev mailing list