- for bound in ty["inner"]["param_names"]:
- check_generic_bound(bound)
- args = ty["inner"]["args"]
- if args:
- if "angle_bracketed" in args:
- for arg in args["angle_bracketed"]["args"]:
- if "type" in arg:
- check_type(arg["type"])
- elif "const" in arg:
- check_type(arg["const"]["type"])
- for binding in args["angle_bracketed"]["bindings"]:
- if "equality" in binding["binding"]:
- term = binding["binding"]["equality"]
- if "type" in term: check_type(term["type"])
- elif "const" in term: check_type(term["const"])
- elif "constraint" in binding["binding"]:
- for bound in binding["binding"]["constraint"]:
- check_generic_bound(bound)
- elif "parenthesized" in args:
- for input_ty in args["parenthesized"]["inputs"]:
- check_type(input_ty)
- if args["parenthesized"]["output"]:
- check_type(args["parenthesized"]["output"])
- if not valid_id(ty["inner"]["id"]):
- print("Type contained an invalid ID:", ty["inner"]["id"])
- sys.exit(1)