OCaml Forge
SCM

Detail: [#770] interactive mode: eval-phrase determines wrong region when query ends on type variable

Bugs: Browse | Download .csv | Monitor

[#770] interactive mode: eval-phrase determines wrong region when query ends on type variable

Date:
2010-10-05 18:08
Priority:
3
State:
Closed
Submitted by:
Ralf Treinen (treinen)
Assigned to:
Nobody (None)
Hardware:
PC
Resolution:
Fixed
Severity:
normal
Version:
None
Component:
None
Operating System:
Linux
Product:
None
 
URL:
Summary:
interactive mode: eval-phrase determines wrong region when query ends on type variable

Detailed description
Tuareg mode 2.0.2-1, but it is the same with the versions in debian stable (1.45.6) and testing (2.0.1)

put in your buffer the single line

type 'a pair = Pair of 'a * 'a;;

and hit C-c C-e. The interpreter output is:

# Characters 29-31:
type 'a pair = Pair of 'a * ';;
^^
Error: Syntax error

Seems like the region corresponding to he phrase to be evaluated is not correctly determined when the phrase ends on a type variable. It works correctly with either of the following variants:

type 'a pair = Pair of 'a * ('a);;
type 'a pair = Pair of 'a * 'a list;;

Followup

Message
Date: 2012-06-06 03:04
Sender: Ralf Treinen

Confirmed, I cannot reproduce any longer the bug with tuareg 2.0.6. I guess this
bug may be closed, now.

Thanks -Ralf.
Date: 2011-12-08 21:51
Sender: Gabriel Scherer

I confirm, the error I reported does not happen anymore with the SVN trunk.
Date: 2011-12-08 19:57
Sender: Christophe Troestler

Could you please test with the latest SVN version? I believe the bug is fixed.
Date: 2011-04-24 06:09
Sender: Gabriel Scherer

One more beginner reporting the error:
http://stackoverflow.com/questions/5767694/why-cant-i-evaluate-this-ocaml-line-with-tuareg-modes-c-c-c-e-command
Date: 2010-10-24 13:59
Sender: Jaz Greetan

I can reproduce this; it is a real bug. Very startling. From within console mode emacs 23.1.1, with tuareg 2.0.1, invoking tuareg-eval-phrase on the line

type 'a mytype = Mytype of 'a ;;

produces, in the *caml-toplevel* buffer, the following error:

# type 'a mytype = Mytype of ';;
Characters 28-30:
type 'a mytype = Mytype of ';;
^^
Error: Syntax error
#

I wish I was a better emacs-lisp hacker, but I'm pretty useless at actually fixing this. Any help or ideas?

Attached Files:

Changes:

Field Old Value Date By
status_idOpen2012-06-06 10:46chris
close_dateNone2012-06-06 10:46chris
ResolutionNone2011-12-09 13:26chris