Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005791OCamltools (ocaml{lex,yacc,dep,debug,...})public2012-10-15 16:152012-10-16 15:25
Assigned Tofrisch 
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 -o main

or as:

  ocamlfind opt -g -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
frisch (developer)
2012-10-15 16:27

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

Yes. Sorry. When I enabled that option, I've got the warning.
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})
2016-12-07 16:37 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser,debug}) => OCaml tools (ocaml{lex,yacc,dep,debug})
2017-02-23 16:45 doligez Category OCaml tools (ocaml{lex,yacc,dep,debug}) => tools (ocaml{lex,yacc,dep,debug,...})

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker