slyubomirsky opened a new pull request #7647:
URL: https://github.com/apache/tvm/pull/7647


   Currently, the type checker returns an `IncompleteTypeNode` for a match 
expression that has no clauses. This means the incomplete type node can be 
unified with another type and be valid even though a match expression with no 
clauses has no defined semantics and shouldn't be permitted. I think it would 
be sensible for the type checker to disallow match expressions with no clauses.
   
   Incidentally, the match completeness checker would normally prevent an empty 
match expression, but they can still pass the type checker if the `complete` 
flag is set to off. Hence a function like this would type check even though it 
makes no sense: `def @main() ->  fn () ->   fn (  ()) ->   bool {   match? 1 
{}}`
   
   This PR checks for empty match expressions and produces a type checking 
error. Bug discovered by fuzzing thanks to @Flandini
   
   Please review @jroesch @MarisaKirisame 


----------------------------------------------------------------
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.

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


Reply via email to