josefs / Gradualizer

A Gradual type system for Erlang
MIT License
613 stars 35 forks source link

module type resolution or non_neg_integer a subtype of Integer #472

Closed tsloughter closed 2 years ago

tsloughter commented 2 years ago

In this code I'm not sure if its not recognizing what trace_id is (a non_neg_integer()) or if it is saying it doesn't know non_neg_integer is an integer?

otel_propagator_trace_context.beam: The function call on line 148 at column 38 is expected to have type opentelemetry:trace_id() but it has type integer()

to_span_ctx(Version, TraceId, SpanId, Opts) ->
    try _ = binary_to_integer(Version, 16),
        otel_tracer:from_remote_span(binary_to_integer(TraceId,
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                       16),
                                                       ^^^
tsloughter commented 2 years ago

Agh, sorry, I misread the code. The ^^^^ are actually very helpful :) This is saying integer() isn't a subtype of non_neg_integer() which is of course correct.

Sorry for the noise.