ORNL / ORNL/GridKit

Bug: JSON parser infers data type from input parameter value

Open
#227 8 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
C++
Stars
27
Forks
11
Avg merge
3d 8h
Merged PRs (30d)
23

Description

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 @ b191e6619bfd7d70a47e24b41fac238e3de1b9f3

System and environment details

Observed on MacOS 15.6.1 with gcc 13.3.0 and clang 16.0.6.

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.