Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize pattern types at the same level as current code #2782

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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