JD557 commented on issue #265:
URL: 
https://github.com/apache/incubator-pekko/issues/265#issuecomment-1479648343

   Just to add my 2 cents regarding the `case _ => throw new 
IllegalStateException()` (especially the `// won't happen, compiler 
exhaustiveness check pleaser`):
   
   The example linked was from a tutorial, so I think it would probably be 
better to have a "good example" there. That comment might make an user think 
"oh, it's OK to just ignore the compiler warnings".
   At least make it a `case unknown => throw new 
IllegalStateException(s"Received unexpected message: $unknown")`.
   
   Although personally I would prefer if the examples actually incentivized 
users to use `sealed trait` everywhere, I can see why that's not the case in 
tutorial 4 (if only union types were available... 😢 ).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to