Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000138OCamlOCaml generalpublic2000-06-12 08:442000-06-12 09:09
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000138: Assertion failure in printtyp.ml
DescriptionFull_Name:
Version: Objective Caml 3.00
OS:
Submission from: orion.kurims.kyoto-u.ac.jp (130.54.16.5)
Submitted by: garrigue


  ~# ocaml
          Objective Caml version 3.00
  
  # type t = string option;;
  type t = string option
  # let (f : t -> string) = function
      None -> ""
    | Some v -> v;;
  val f : t -> string = <fun>
  # let g ?opt () = f opt;;
  val g : ?opt:Uncaught exception: File "typing/printtyp.ml", line 0, characters
6494-6506: Assertion failed

The same message was printed when trying to compile the code.
Perhaps a better error message could be used?

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000406)
administrator (administrator)
2000-06-12 09:04

> # type t = string option;;
> type t = string option
> # let (f : t -> string) = function
> None -> ""
> | Some v -> v;;
> val f : t -> string = <fun>
> # let g ?opt () = f opt;;
> val g : ?opt:Uncaught exception: File "typing/printtyp.ml", line 0,
characters
> 6494-6506: Assertion failed
>
> The same message was printed when trying to compile the code.
> Perhaps a better error message could be used?

Indeed. Due to the structure of the compiler, it would difficult to
get the correct type printed, but I changed it so as to have partial type
information (and no error).

# let g ?opt () = f opt;;
val g : ?opt:<hiddent> -> unit -> string

The only way to have the system print the correct type is to write a module
signature... (A type constraint would not do, since it propagates
abbreviation.)

    Jacques Garrigue
(0000407)
administrator (administrator)
2000-06-12 09:09

Partially fixed by Jacques on 2000-06-12.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker