-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expressions like 3#0;; are ignored by the toplevel and the compiler #6604
Description
Original bug ID: 6604
Reporter: rdicosmo
Assigned to: @gasche
Status: resolved (set by @gasche on 2017-10-04T09:07:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.06.0 +dev/beta1/beta2/rc1
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: lexing and parsing
Tags: junior_job
Bug description
The very simple syntactically incorrect expression 3#0;; is simply ignored both by the toplevel and the compiler. On the other hand, 3#foo;; is handled properly
Steps to reproduce
Just type 3#0;; in any toplevel (tested 3.12 , 4.00, 4.01 and 4.02)
$ ocaml
OCaml version 4.01.0
3#0;;
^CInterrupted.
3#foo;;
Error: This expression has type int
It has no method foo
Or try to compile a file containing the single line
3#0;;
Additional information
The interpreter executed via js_of_ocaml (see try.ocamlpro.org, for example) does not exhibit this behaviour.
Welcome to TryOCaml (v. 4.01.0)
3#0;;
File "", line 1, characters 2-3:
Error: Syntax error
File "", line 1, characters 3-5:
Error: Syntax error