Need better error message for qp
- Dominant language
- Haskell
- Stars
- 24
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
### Expected Behaviour
qp() currently only supports constant values for certain arguments, and should produce an error message stating this when a call to qp() has a non-constant expression for one of these arguments.
### Actual Behaviour
When a non-constant value is passed for the argument _period_, the problem is not caught until a later stage of processing, producing the unhelpful error message "`toModelBody requires an argument in BasicModel form`."
#### Sample Code that illustrates the problem
```
def main(rhop: real{0.0, 1.0}, sigmap: real, period: real{0.0,})
=
ell = 0.7;
mindof = 6;
qp(period, ell, mindof, rhop, sigmap)
```
Contributor guide
Research direction
Start by locating qp() handling and the later toModelBody stage described in the issue, using the sample model to reproduce the failure with a non-constant period. Trace where constant arguments are validated, then confirm that qp() reports the invalid argument before later processing instead of emitting the BasicModel error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100