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

Add variable name to unused resource error message. #7

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions compiler/error.ml
Expand Up @@ -428,9 +428,9 @@ let forgot_branch p1 p2 =
err "In this branch" ;
exit 2

let unused_variable p =
let unused_variable (p: Pos.t) (id: string) =
pos p ;
err ("This ressource hasn't been used") ;
err ("The resource `" ^ id ^ "' has not been used") ;
exit 2

let already_used p p' =
Expand Down
2 changes: 1 addition & 1 deletion compiler/linearCheck.ml
Expand Up @@ -273,7 +273,7 @@ end = struct
IMap.iter (
fun x ty ->
match ty with
| Var (p, _) -> Error.unused_variable p
| Var (p, x) -> Error.unused_variable p (Ident.to_string x)
| _ -> ()
) env

Expand Down