Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005791OCamlOCaml tools (ocaml{lex,yacc,dep,browser,debug})public2012-10-15 16:152012-10-16 15:25
Reporterkosik 
Assigned Tofrisch 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version4.00.1 
Target VersionFixed in Version 
Summary0005791: Some unused variables go undetected
DescriptionOcaml detects and reports unused variables.
This feature is useful.
However, when I bind variables by pattern-matching a record-value, Ocaml compiler does not report bound but otherwise unused variables which is probably not an expected behavior, I guess.
Steps To ReproduceWhen I try to compile the following program:

  type foo = {bar:int; baz:string}

  ;;

  match {bar=5; baz="five"} with
    | {bar; baz} -> ();

either as:

  ocamlfind c -g main.ml -o main

or as:

  ocamlfind opt -g main.ml -o main

I do not get the usual warnings about unused variables (in this case "bar" and "baz").
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008256)
frisch (developer)
2012-10-15 16:27

Are you sure warning 27, and not only 26, is enabled?
(0008257)
kosik (reporter)
2012-10-15 16:43

Yes. Sorry. When I enabled that option, I've got the warning.
(0008258)
kosik (reporter)
2012-10-15 16:48

So I think I raised a false alarm, actually.

- Issue History
Date Modified Username Field Change
2012-10-15 16:15 kosik New Issue
2012-10-15 16:27 frisch Note Added: 0008256
2012-10-15 16:43 kosik Note Added: 0008257
2012-10-15 16:48 kosik Note Added: 0008258
2012-10-16 15:25 frisch Status new => closed
2012-10-16 15:25 frisch Assigned To => frisch
2012-10-16 15:25 frisch Resolution open => no change required
2013-08-19 15:58 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser}) => OCaml tools (ocaml{lex,yacc,dep,browser,debug})


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker