Invalid integer parameters cause a confusing error message

Create issue
Issue #1469 closed
Ian Hinder created an issue

If an integer-valued parameter is assigned a value such as 100000000000000000000000 which is too large to fit into an integer, the Piraha parameter parser interprets it as a real and complains

  (line 15 of sim.par): 
-> Parameter type mismatch INT != REAL

This message is not very helpful. A better error message might be:

  (line 15 of sim.par): 
-> Parameter MyThorn::mypar cannot be set to the value 10000000000000000000 as this is not a valid INT value


Comments (9)

  1. Ian Hinder reporter
    • removed comment

    If a fix is not immediately obvious, this should be reverted. It means the flesh is broken, which is quite serious, and not supposed to happen :(

  2. Steven R. Brandt
    • changed status to resolved
    • removed comment

    Fixed. Very sorry everyone.

    This new version definitely solves the problem. It detects values out of range for both double and int.

  3. Log in to comment