-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Elixir and Erlang/OTP versions
Erlang/OTP 28 [erts-16.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Elixir 1.18.4 (compiled with Erlang/OTP 25)
Operating system
Ubuntu 24.04
Current behavior
defmodule Test do
@spec run_task() :: Task.t()
def run_task do
Task.Supervisor.async(SupervisorName, fn ->
# Your task implementation here
:ok
end)
end
end=>
lib/test.ex:2:contract_with_opaque
The @spec for Test.run_task/0 has an opaque
subtype %Task{
:mfa => {atom(), atom(), byte()},
:owner => pid(),
:pid => nil | pid(),
:ref => Task.ref()
} which is violated by the success typing.
Success typing:
() :: %Task{
:mfa => {_, _, non_neg_integer()},
:owner => pid(),
:pid => atom() | pid() | port() | {atom(), atom()},
:ref => reference()
}
Expected behavior
No Warning
Metadata
Metadata
Assignees
Labels
No labels