code: def test_too_specific_match():
      mod = tvm.IRModule()
      p = Prelude(mod)
      _, cons, nil = mod.get_type("List")
  
      v = relay.Var("v")
      match = relay.Match(
          v,
          [
              relay.Clause(
                  relay.PatternConstructor(
                      cons,
                      [
                          relay.PatternWildcard(),
                          relay.PatternConstructor(
                              cons,
                              [
                                  relay.PatternWildcard(),
                                  relay.PatternWildcard(),
                              ],
                          ),
                      ],
                  ),
                  v,
              )
          ],
      )
  
      unmatched = unmatched_cases(match, mod)
  
      # will not match nil or a list of length 1
      nil_found = False
      single_length_found = False
      assert len(unmatched) == 2
      for case in unmatched:
          assert isinstance(case, relay.PatternConstructor)
          if case.constructor == nil:
              nil_found = True
          if case.constructor == cons:
              assert isinstance(
                  case.patterns[1], relay.PatternConstructor
              )
              assert case.patterns[1].constructor == nil
              single_length_found = True
      assert nil_found and single_length_found
  
      # if we add a wildcard, this should work
      new_match = relay.Match(
          v,
          [
              relay.Clause(
                  relay.PatternConstructor(
                      cons,
                      [
                          relay.PatternWildcard(),
                          relay.PatternConstructor(
                              cons,
                              [
                                  relay.PatternWildcard(),
                                  relay.PatternWildcard(),
                              ],
                          ),
                      ],
                  ),
                  v,
              ),
              relay.Clause(relay.PatternWildcard(), v),
          ],
      )
      assert len(unmatched_cases(new_match, mod)) == 0
  
file_path: tvm/tests/python/relay/test_pass_unmatched_cases.py
imports: import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay.prelude import Prelude
  from tvm.relay.analysis import unmatched_cases
  import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_too_specific_match() without return types