Skip to content

** (FunctionClauseError) no function clause matching in TypedEctoSchema.EctoTypeMapper.disjunction_typespec/1 #57

@JVMartyns

Description

@JVMartyns

typed_ecto_schema v0.4.3

Example of field that causes the error:

field(:foo, {:array, Ecto.Enum}, values: [], default: []) :: list(String.t())

== Compilation error

** (FunctionClauseError) no function clause matching in TypedEctoSchema.EctoTypeMapper.disjunction_typespec/1

    The following arguments were given to TypedEctoSchema.EctoTypeMapper.disjunction_typespec/1:

        # 1
        []

    Attempted function clauses (showing 1 out of 1):

        defp disjunction_typespec([entry | _rest] = all)

    (typed_ecto_schema 0.4.3) lib/typed_ecto_schema/ecto_type_mapper.ex:136: TypedEctoSchema.EctoTypeMapper.disjunction_typespec/1
    (typed_ecto_schema 0.4.3) lib/typed_ecto_schema/ecto_type_mapper.ex:84: TypedEctoSchema.EctoTypeMapper.base_type_for/2
    (typed_ecto_schema 0.4.3) lib/typed_ecto_schema/ecto_type_mapper.ex:45: TypedEctoSchema.EctoTypeMapper.type_for/4
    (typed_ecto_schema 0.4.3) lib/typed_ecto_schema/type_builder.ex:128: TypedEctoSchema.TypeBuilder.add_field/5

Perhaps it would be better to issue an error message?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions