Skip to content

Native erlang:timestamp() type triggers error under Erlang/OTP 17.3 #94

Closed
@danielwhite

Description

@danielwhite

The following has been compiled and run under both R16B03-1 and 17.3.

-module(example).

-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").

native_test() ->
    proper:quickcheck(
      ?FORALL(_Timestamp, erlang:timestamp(), begin true end)).

%% Not sure why, by the native timestamp doesn't work in 17.3+.
-type timestamp() :: {MegaSecs :: non_neg_integer(),
                      Secs :: non_neg_integer(),
                      MicroSecs :: non_neg_integer()}.

internal_test() ->
    proper:quickcheck(
      ?FORALL(_Timestamp, timestamp(), begin true end)).

In the case of native_test, then the following error will be raised:

=ERROR REPORT==== 3-Nov-2014::15:23:08 ===
** Generic server <0.47.0> terminating 
** Last message in was {translate_type,{example,"erlang:timestamp()"}}
** When Server state == {state,{dict,0,16,16,8,80,48,
                                     {[],[],[],[],[],[],[],[],[],[],[],[],[],
                                      [],[],[]},
                                     {{[],[],[],[],[],[],[],[],[],[],[],[],[],
                                       [],[],[]}}},
                               {dict,0,16,16,8,80,48,
                                     {[],[],[],[],[],[],[],[],[],[],[],[],[],
                                      [],[],[]},
                                     {{[],[],[],[],[],[],[],[],[],[],[],[],[],
                                       [],[],[]}}},
                               {dict,0,16,16,8,80,48,
                                     {[],[],[],[],[],[],[],[],[],[],[],[],[],
                                      [],[],[]},
                                     {{[],[],[],[],[],[],[],[],[],[],[],[],[],
                                       [],[],[]}}},
                               {dict,0,16,16,8,80,48,
                                     {[],[],[],[],[],[],[],[],[],[],[],[],[],
                                      [],[],[]},
                                     {{[],[],[],[],[],[],[],[],[],[],[],[],[],
                                       [],[],[]}}}}
** Reason for termination == 
** {function_clause,
       [{proper_typeserver,'-update_vars/3-lc$^1/1-1-',
            [any],
            [{file,"src/proper_typeserver.erl"},{line,1079}]},
        {proper_typeserver,update_vars,3,
            [{file,"src/proper_typeserver.erl"},{line,1079}]},
        {proper_typeserver,'-unbound_to_any/2-lc$^0/1-0-',2,
            [{file,"src/proper_typeserver.erl"},{line,821}]},
        {proper_typeserver,unbound_to_any,2,
            [{file,"src/proper_typeserver.erl"},{line,821}]},
        {dict,map_bucket,2,[{file,"dict.erl"},{line,453}]},
        {dict,map_bucket,2,[{file,"dict.erl"},{line,453}]},
        {dict,map_bkt_list,2,[{file,"dict.erl"},{line,449}]},
        {dict,map_seg_list,2,[{file,"dict.erl"},{line,444}]}]}
undefined
*unexpected termination of test process*
::{function_clause,
      [{proper_typeserver,'-update_vars/3-lc$^1/1-1-',
           [any],
           [{file,"src/proper_typeserver.erl"},{line,1079}]},
       {proper_typeserver,update_vars,3,
           [{file,"src/proper_typeserver.erl"},{line,1079}]},
       {proper_typeserver,'-unbound_to_any/2-lc$^0/1-0-',2,
           [{file,"src/proper_typeserver.erl"},{line,821}]},
       {proper_typeserver,unbound_to_any,2,
           [{file,"src/proper_typeserver.erl"},{line,821}]},
       {dict,map_bucket,2,[{file,[...]},{line,...}]},
       {dict,map_bucket,2,[{file,...},{...}]},
       {dict,map_bkt_list,2,[{...}|...]},
       {dict,map_seg_list,2,[...]}]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions