Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

RFC ~ types-proposal: should help hackney, mech, hamcrest, poolboy, syslog,… #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fenollp
Copy link
Owner

@fenollp fenollp commented Apr 26, 2018

… jesse, rebar3, relx, eunit_formatters, bbmustache, riak_core, ...

… jesse, rebar3, relx, eunit_formatters, bbmustache, riak_core, ...
@fenollp
Copy link
Owner Author

fenollp commented Apr 26, 2018

Another idea, probably more handy would be:

-ifdef(OTP_VSN_17_AND_ABOVE).
-type queue() :: queue:queue().
-endif.

Then it would be used as:

%% ... no type defs nor includes ...
-include_lib("otp_vsn/include/otp_vsn.hrl").
%% ...
-record(state, {q :: queue(), ...

And an opt-out macro that could be defined before the include:

-define(OTP_VSN_WITHOUT_NAMESPACED_TYPES, true).
-include_lib("otp_vsn/include/otp_vsn.hrl").
%% type queue() is now a compile error on OTP 17.0 and later

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant