You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1555 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Hugo Herbelin
Version: 3.06
OS: linux
Submission from: herbelin.net1.nerim.net (62.212.105.93)
Bonjour,
I fell on a funny behaviour of ast-based preprocessing wrt to useless pattern
detection.
When preprocessed with camlp4o the following program reports an incorrect
useless pattern.
% cat foo.ml
let f = function
| 'b' -> 1
| 'a'..'c' -> 2
| _ -> 3
% ocamlc -pp 'camlp4o' -c -impl ~/foo.ml
File "/home/herbelin/toto.ml", line 3, characters 4-12:
Warning: this pattern is unused.
When communicating via ocaml parser, it is correct though (no warning).
% ocamlc -pp 'camlp4o pr_o.cmo' -c -impl ~/foo.ml
In both cases, the .cmo is the same, so it really just seems to be that the
useless pattern detection is not happy with the abstract syntax tree returned by
camlp4 (perhaps is 'a'..'c' then expanded) ?
Thanks for all.
Hugo
The text was updated successfully, but these errors were encountered:
Full_Name: Hugo Herbelin
Version: 3.06
OS: linux
Submission from: herbelin.net1.nerim.net (62.212.105.93)
Bonjour,
I fell on a funny behaviour of ast-based preprocessing wrt to useless pattern
detection.
When preprocessed with camlp4o the following program reports an incorrect
useless pattern.
% cat foo.ml
let f = function
| 'b' -> 1
| 'a'..'c' -> 2
| _ -> 3
% ocamlc -pp 'camlp4o' -c -impl ~/foo.ml
File "/home/herbelin/toto.ml", line 3, characters 4-12:
Warning: this pattern is unused.
When communicating via ocaml parser, it is correct though (no warning).
% ocamlc -pp 'camlp4o pr_o.cmo' -c -impl ~/foo.ml
In both cases, the .cmo is the same, so it really just seems to be that the
useless pattern detection is not happy with the abstract syntax tree returned by
camlp4 (perhaps is 'a'..'c' then expanded) ?
Thanks for all.
Hugo
Hi, I think you are right, at least the observed behavior can be
explained as you do : 'a'..'c' is expanded by camlp4.
However some << ghost location >> mecanism shoud prevent the warning.
I probably missed something here.
Original bug ID: 1555
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Hugo Herbelin
Version: 3.06
OS: linux
Submission from: herbelin.net1.nerim.net (62.212.105.93)
Bonjour,
I fell on a funny behaviour of ast-based preprocessing wrt to useless pattern
detection.
When preprocessed with camlp4o the following program reports an incorrect
useless pattern.
% cat foo.ml
let f = function
| 'b' -> 1
| 'a'..'c' -> 2
| _ -> 3
% ocamlc -pp 'camlp4o' -c -impl ~/foo.ml
File "/home/herbelin/toto.ml", line 3, characters 4-12:
Warning: this pattern is unused.
When communicating via ocaml parser, it is correct though (no warning).
% ocamlc -pp 'camlp4o pr_o.cmo' -c -impl ~/foo.ml
In both cases, the .cmo is the same, so it really just seems to be that the
useless pattern detection is not happy with the abstract syntax tree returned by
camlp4 (perhaps is 'a'..'c' then expanded) ?
Thanks for all.
Hugo
The text was updated successfully, but these errors were encountered: