Skip to content

Unclear error message in 4.01.0 #6295

@vicuna

Description

@vicuna

Original bug ID: 6295
Reporter: @dbuenzli
Status: closed (set by @gasche on 2014-01-17T09:03:08Z)
Resolution: duplicate
Priority: normal
Severity: minor
Version: 4.01.0
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #6173
Monitored by: @hcarty @dbuenzli

Bug description

For the following (wrong) code,

> opam-switch-eval 4.01.0
> ocaml
        OCaml version 4.01.0

#  let _ = 
      try 
        while true do if true then raise Exit done
      with Exit -> 1 :: []
    ;;
Error: The variant type unit has no constructor ::

the error message was much clearer in 4.00.1:

> opam-switch-eval 4.00.1
> ocaml
        OCaml version 4.00.1
# let _ = 
    try 
      while true do if true then raise Exit done
    with Exit -> 1 :: []
  ;;
Error: This expression has type 'a list
       but an expression was expected of type unit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions