summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-06-14 00:08:05 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-06-14 00:08:05 +0200
commit6fa7e4e9b9a40512c9160b83dc23d4b61e4e1e9c (patch)
treefa7312b21c5008ae42afe39870ce0bff088b8287
parentae9e9c463faf6187e63374ebcb1443d036bb4b5a (diff)
downloadperl_checker-6fa7e4e9b9a40512c9160b83dc23d4b61e4e1e9c.tar
perl_checker-6fa7e4e9b9a40512c9160b83dc23d4b61e4e1e9c.tar.gz
perl_checker-6fa7e4e9b9a40512c9160b83dc23d4b61e4e1e9c.tar.bz2
perl_checker-6fa7e4e9b9a40512c9160b83dc23d4b61e4e1e9c.tar.xz
perl_checker-6fa7e4e9b9a40512c9160b83dc23d4b61e4e1e9c.zip
warn when @ISA / "use base" is used more than once
make it a warning instead of dying (needed for Parted bindings)
-rw-r--r--NEWS3
-rw-r--r--src/tree.ml2
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 37c133d..0ea6edb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- don't die when @ISA or "use base" is used more than once,
+ make it a warning instead (needed for Parted bindings)
+
Version 1.2.26 - 24 February 2014, by Thierry Vignaud
- fix "undeclared variable $_" false positive on List::Util::first()
diff --git a/src/tree.ml b/src/tree.ml
index d0faf80..ec312e7 100644
--- a/src/tree.ml
+++ b/src/tree.ml
@@ -205,7 +205,7 @@ let get_uses t =
let get_isa t =
let get_isa_ isa exporter pos classes =
- if isa <> None || exporter <> None then die_with_pos pos "\"use base\" and \"@ISA\" must be used once only";
+ if isa <> None || exporter <> None then warn_with_pos [Warn_strange] pos "\"use base\" and \"@ISA\" must be used once only";
let special, l = List.partition (fun (s, _) -> s = "DynaLoader" || s = "Exporter") classes in
let exporter = if List.mem_assoc "Exporter" special then Some pos else None in
let isa = if l = [] && special <> [] then None else Some l in