Skip to content

val throws an error on arbitrary types #1177

@felixcremer

Description

@felixcremer

According to the docstring the of val

Objects that don't define a val method are returned unaltered.

When I try this with a Number or a Dict I get an error. I ran into this, when I wanted to implement merge for AbstractMetadata.
This is on version 0.30

julia> val(1)
ERROR: MethodError: no method matching val(::Int64)
The function `val` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  val(::DimTable, Any...)
   @ DimensionalData ~/Documents/Privat/AIRCentre_Dashboard/CretaceanView/dev/DimensionalData/src/tables.jl:167
  val(::Tuple{})
   @ DimensionalData ~/Documents/Privat/AIRCentre_Dashboard/CretaceanView/dev/DimensionalData/src/Dimensions/dimension.jl:225
  val(::DimensionalData.Dimensions.Lookups.NoMetadata)
   @ DimensionalData ~/Documents/Privat/AIRCentre_Dashboard/CretaceanView/dev/DimensionalData/src/Lookups/metadata.jl:80
  ...

Stacktrace:
 [1] top-level scope
   @ REPL[21]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions