diff --git a/src/lib/initial_check.ml b/src/lib/initial_check.ml index 055b94598..14dd536d7 100644 --- a/src/lib/initial_check.ml +++ b/src/lib/initial_check.ml @@ -545,6 +545,7 @@ let rec to_ast_typ_pat ctx (P.ATyp_aux (aux, l)) = | P.ATyp_app (P.Id_aux (P.Id "bool", il), typs) -> TP_aux (TP_app (Id_aux (Id "atom_bool", il), List.map (to_ast_typ_pat ctx) typs), l) | P.ATyp_app (f, typs) -> TP_aux (TP_app (to_ast_id ctx f, List.map (to_ast_typ_pat ctx) typs), l) + | P.ATyp_parens atyp -> to_ast_typ_pat ctx atyp | _ -> raise (Reporting.err_typ l "Unexpected type in type pattern") let is_wild_fpat = function P.FP_aux (P.FP_wild, _) -> true | _ -> false diff --git a/test/typecheck/pass/type_pat_parens.sail b/test/typecheck/pass/type_pat_parens.sail new file mode 100644 index 000000000..5b2f431ae --- /dev/null +++ b/test/typecheck/pass/type_pat_parens.sail @@ -0,0 +1,9 @@ +default Order dec + +$include + +val main : unit -> unit + +function main() = { + let _ as bool((((('b))))) = true; +}