Skip to content

Type error in GenServer in TypedServer demo #64

@erszcz

Description

@erszcz

When any of the TypedGenServer.StageN.Server modules get use GenServer uncommented Gradient.type_check_file reports:

iex(7)> recompile(); Gradient.type_check_file(:code.which( TypedGenServer.Stage1.Server ), [:infer])
Compiling 1 file (.ex)
lib/typed_gen_server/stage1.ex: The variable on line 755 is expected to have type child_spec() | {module(), term()} | module() but it has type %{
  optional(:id) => TypedGenServer.Stage1.Server,
  optional(:start) => {TypedGenServer.Stage1.Server, :start_link, nonempty_list(any())}
}


:error

Not to clutter the demo we just comment GenServer use out, but ultimately, we want GenServer to type check properly - either by fixing it if there's an actual problem, or by fixing a false positive if it is one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions