Skip to content

Commit

Permalink
It looks like pattern types need to be generalized at the same level …
Browse files Browse the repository at this point in the history
…as the current execution. Fixes: #2773
  • Loading branch information
toots committed Dec 8, 2022
1 parent da5b8cf commit 059c136
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lang/typechecking.ml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ let rec check ?(print_toplevel = false) ~throw ~level ~(env : Typing.env) e =
(* Printf.printf "generalize at %d: %B\n\n!" level (value_restriction def); *)
if value_restriction def then fst (generalize ~level def.t) else []
in
let penv, pa = type_of_pat ~level:(level + 1) ~pos pat in
let penv, pa = type_of_pat ~level ~pos pat in
def.t <: pa;
let penv =
List.map
Expand Down
17 changes: 17 additions & 0 deletions tests/language/type_errors.liq
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,23 @@ def f() =
end
")

incorrect('
def g() =
s = single("foo")

s = s

enc = %ffmpeg(
format="mkv",
%audio(codec="aac"),
%video(codec="aac")
)

output.file(fallible=true, enc, "/tmp/bla.mkv", s)

ignore(ffmpeg.decode.audio(s))
end')

test.pass()
end

Expand Down

0 comments on commit 059c136

Please sign in to comment.