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

error message not good for unmatched paren when using #use in toplevel #6906

Closed
vicuna opened this issue Jun 17, 2015 · 1 comment
Closed
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented Jun 17, 2015

Original bug ID: 6906
Reporter: @kenichi-asai
Status: closed (set by @damiendoligez on 2016-04-18T09:52:31Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: Apple
OS: MacOS X
OS Version: 10.8
Version: 4.02.1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche

Bug description

When a file with unmatched parenthesis is loaded to OCaml top-level using #use, the error message does not show the file name, line and character numbers, but refers to "this expression" with underline at inappropriate place.

Steps to reproduce

When I have a file with unmatched parenthesis:

test.ml:
1 + (2 * 3

and include it using #use, the ocaml toplevel says:

% ocaml
OCaml version 4.02.1

#use "test.ml";;

Syntax error: ')' expected, the highlighted '(' might be unmatched

with underline at the space immediately after "#use", but it should
show a file name, line number, and characters.

Additional information

In case of a type error:

test.ml:
1 + (2 *. 3)

% ocaml
OCaml version 4.02.1

#use "test.ml";;

File "test.ml", line 1, characters 5-6:
Error: This expression has type int but an expression was expected of type
float

It displays the place of the error correctly. (In OCaml 3.12.1, both
worked fine.)

@vicuna
Copy link
Author

vicuna commented Apr 18, 2016

Comment author: @damiendoligez

Fixed in 4.03 (commit f2e1274)
and trunk (commit 033ffae).

@vicuna vicuna closed this as completed Apr 18, 2016
@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant