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

Print terms that invented types when type_invention_error is set #88

Merged
merged 1 commit into from
Jan 13, 2024

Conversation

aqjune
Copy link
Contributor

@aqjune aqjune commented Jan 12, 2024

When type_invention_error flag is set, this patch prints the terms that invented types. This is helpful for debugging when every term is supposed to be fully typed but it actually isn't.

 # type_invention_error := true;;
 val it : unit = ()
 # let tm = `x = x`;;
 Exception:
 Failure "typechecking error (cannot infer type of variables): =, x".
 #

When `type_invention_error` flag is set, this patch prints the terms that invented types.
This is helpful for debugging when very term is supposed to be fully typed but it actually isn't.

```
 # type_invention_error := true;;
 val it : unit = ()
 # let tm = `x = x`;;
 Exception:
 Failure "typechecking error (cannot infer type of variables): =, x".
 #
```
(* ----------------------------------------------------------------------- *)

let stvs_translated = ref false in
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stvs_translated is removed in this patch. It is a local variable defined inside the outer function, so okay to be erased.

Copy link
Owner

@jrh13 jrh13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, a helpful improvement.

@jrh13 jrh13 merged commit b2b6304 into jrh13:master Jan 13, 2024
2 checks passed
@aqjune aqjune deleted the print_typed_var branch January 13, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants