Skip to content

Bug: JSON parser infers data type from input parameter value #227

@pelesh

Description

@pelesh

Description how to reproduce the bug

JSON parser infers parameter data type from its value. This among other things will cause that floating point parameter is interpreted as integer if it is entered without decimal point in the input file. Retrieving this parameter as a floating point type will then cause an exception to be throw:

terminate called after throwing an instance of 'std::bad_variant_access'
Abort trap: 6

Possible solutions are

  • to interpret every parameter as the floating point number
  • have separate enums for real, integer and boolean parameters.

@superwhiskers

GridKit™ version

develop @ b191e66

System and environment details

Observed on MacOS 15.6.1 with gcc 13.3.0 and clang 16.0.6.

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions