dialyzer Questions

2

Solved

I have the following code: @spec test_pass(String.t) :: (:failed | {:ok, map()}) def test_pass(pass) do db_user = %{password_hash: @hash_for_foo} with {:ok, ^db_user} <- Comeonin.Argon2.check_...
Cohin asked 4/4, 2018 at 21:45

1

Solved

I have some code that is failing dialyzer and I cannot understand why. No matter what I put into the @spec at the top of the function, calls to that function return a puzzling dialyzer error. Here ...
Elbertelberta asked 14/11, 2018 at 14:24

1

Solved

Equivalently, how can I typespec for a "single" UTF8 char? Within a type definition, I can have generic "any string" or "any utf8 string" with @type tile :: String.t # matches any string @type ti...
Astrahan asked 8/1, 2018 at 15:33

1

Solved

I created new Mix.Task in /lib/mix/tasks/start.ex for my project defmodule Mix.Tasks.Start do use Mix.Task def run(_), do: IO.puts("Hello, World!") end Now, it could be run from console like ...
Diagram asked 6/7, 2018 at 10:29

2

Solved

I'm learning Erlang and trying to use Dialyzer to get maximum type-safety when it's possible. There's a thing that I don't understand: what is the type of non-terminating function and how to denote...
Yasminyasmine asked 12/5, 2016 at 10:49

2

Solved

The following Erlang code seems to have an obvious error in its type specification, but dialyzer says that everything is ok. Am I misunderstanding or is this a bug in dialyzer? Running on Erlang 19...
Beaumarchais asked 4/3, 2018 at 2:26

1

Solved

Is it possible to define a type as follows: defmodule Role do use Exnumerator, values: ["admin", "regular", "restricted"] @type t :: "admin" | "regular" | "restricted" @spec default() :: t d...
Reger asked 15/11, 2017 at 19:14

1

Solved

I have a behaviour X and a callback function with parameter type: %{a: any} Module Y implements behaviour X and the callback function in implementing module Y has parameter type: %{a: any, b: a...
Protrusile asked 20/9, 2017 at 6:25

1

Dialyzer version 2.9. Erts 7.3. OTP 18. In the following contrived erlang code: -module(dialBug). -export([test/0]). %-export([f1/1]). % uncomment this line test() -> f1(1). f1(X) when X &g...
Quietus asked 17/9, 2017 at 10:7

2

Solved

-module(test). -export([f/0, g/0]). -spec f() -> RESULT when RESULT :: 0..12 . -spec g() -> RESULT when RESULT :: 0..13 . f () -> 100 . g () -> 100 . Running dialyzer (and typer...
Hood asked 9/4, 2017 at 14:34

1

free_vars_in_dterm({var, V}) -> {var, V}; obviously cannot type check, however, dialyzer says everything is OK. $ dialyzer *erl Checking whether the PLT ~/.dialyzer_plt is up-to-date... yes P...
Subadar asked 28/3, 2017 at 13:1

1

I am using the elixir_talk library. After connecting I want to call a private function once connected to beanstalkd. I just added typespecs and ran Dialyzer (via dialyxir). I get the errors: my_mo...
Bergess asked 16/5, 2016 at 13:41

1

Solved

I have a project that doesn't have -spec or -type in code, currently dialyzer can find some warnings, most of them are in machine generated codes. Will adding type specs to code make dialyzer find...
Kwiatkowski asked 21/12, 2015 at 7:5

1

Solved

I am trying to figure out how to combine parameterized types and type variables in Elixir type and function specs. As a simple example, let's say I am defining a Stack module: defmodule Stack do ...
Cash asked 3/11, 2015 at 0:49

1

Solved

In my progress of learning Elixir, I am playing around with Dialyzer to put types on my functions. In this regard, I've noticed that Dialyzer doesn't seem to check the types for anonymous functions...
Crowfoot asked 9/7, 2015 at 2:14

1

Solved

When implementing NIFs, Dialyzer gives me Function crc16/1 has no local return probably because I do exit in the .erl module (like the official docs recommend): -module(my_nifs). -export([crc...
Immolation asked 28/10, 2014 at 15:47

3

I'm learning Elixir, and the tool 'dialyzer' lets you do static analysis - annotate the function definition with the type specification of the parameters it expects and the output it returns. It's ...
Hufford asked 9/5, 2014 at 6:3

2

Solved

I'm using lager to do my logging; it has a parser transform which converts lager:warn/1, etc. functions into lager:trace... functions. dialyzer doesn't process the parser transform, so it warns wi...
Bobbe asked 5/12, 2013 at 16:18

2

Solved

I am reading with interest the online book "learn you some erlang" and trying some exercises to check my understanding. I made some modification on the fifo example, in the chapter Type S...
Wifeless asked 30/8, 2012 at 12:54

2

I've created the snippet below based on this tutorial. The last two lines (feed_squid(FeederRP) and feed_red_panda(FeederSquid)) are obviously violating the defined constraints, yet Dialyzer finds ...
Shelli asked 7/8, 2012 at 18:8
1

© 2022 - 2024 — McMap. All rights reserved.