Permalink
Browse files

Avoid warnings on namespaced types.

The solution is taken from https://github.com/eproxus/meck.
  • Loading branch information...
1 parent 8a90a12 commit 4a9ab0add0be9a3018b7c4547d8571f34eff6934 @kape1395 kape1395 committed Oct 20, 2014
Showing with 10 additions and 2 deletions.
  1. +8 −0 include/hamcrest_internal.hrl
  2. +1 −1 rebar.config
  3. +1 −1 src/hamcrest_matchers.erl
@@ -26,6 +26,14 @@
%% @copyright 2010 Tim Watson.
%% -----------------------------------------------------------------------------
+-ifdef(namespaced_types).
+ -type hc_set() :: dict:set().
+ -type hc_gb_set() :: dict:gb_set().
+-else.
+ -type hc_set() :: set().
+ -type hc_gb_set() :: gb_set().
+-endif.
+
-record('hamcrest.matchspec', {
matcher = undefined :: fun((term()) -> boolean()),
expected = undefined :: term(),
View
@@ -1,6 +1,6 @@
{lib_dirs, ["deps"]}.
-{erl_opts, [debug_info, fail_on_warning]}.
+{erl_opts, [debug_info, fail_on_warning, {platform_define, "^[0-9]+", namespaced_types}]}.
{clean_files, ["logs", "build", "include/hamcrest.hrl"]}.
{plugin_dir, "priv/build/plugins"}.
@@ -75,7 +75,7 @@
%%%============================================================================
-type matchfun(A) :: fun((A) -> boolean()).
--type container_t() :: list() | set() | gb_set().
+-type container_t() :: list() | hc_set() | hc_gb_set().
%%%============================================================================
%%% API

0 comments on commit 4a9ab0a

Please sign in to comment.