Skip to content

Fix get_experiment_result dialyzer error #6

Description

@mkurkov

Overview

Dialyzer returns error about get_experiment_result function type:

Total errors: 1, Skipped: 0, Unnecessary Skips: 0
done in 0m1.18s
lib/growth_book.ex:86:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
GrowthBook.get_experiment_result/6

Success typing:
@spec get_experiment_result(
  %GrowthBook.Context{:attributes => nil | maybe_improper_list() | map(), _ => _},
  %GrowthBook.Experiment{:hash_attribute => _, :meta => _, :variations => _, _ => _},
  _,
  _,
  _,
  _
) :: %GrowthBook.ExperimentResult{
  :bucket => _,
  :feature_id => _,
  :hash_attribute => _,
  :hash_used? => _,
  :hash_value => _,
  :in_experiment? => boolean(),
  :key => _,
  :name => _,
  :passthrough? => _,
  :sticky_bucket_used? => nil,
  :value => _,
  :variation_id => integer()
}

________________________________________________________________________________
done (warnings were emitted)
Halting VM with exit status 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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