New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve where clause unmet error #1883
Comments
What would that look like? In the vast majority of cases it'd be a |
|
Perhaps we should store the code of the constraint as a string somewhere as well, something akin “use trace” does but then very locally?
… On 30 May 2018, at 13:05, Zoffix Znet ***@***.***> wrote:
print the actual name of the constraint
What would that look like? In the vast majority of cases it'd be a Callable without a name (hence the "anonymous") and they'd all just have a ;; $_? is raw as signature, making printing that detrimental rather than useful.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm a bit worried about this type of errors one day ending up in some public error log. Same as value-printing errors can reveal credit card numbers, the code-dumping errors can reveal important pieces of the program. And would very long Callables be abridged or dumped as is, flooding the screen with code? Also, wouldn't already-high memory use be even higher if we store the code itself together with all the anonymous Callables? The user is in full control of what error shows up on typecheck. There's even a |
|
Wouldn't just the .gist of the where clause be enough here?
|
|
This is an old issue, but I think the goal is worthy, so I wanted to open up discussion. I suspect providing the constraint code in current implementation may not be easy as the "text" of the constrain is simply not available, but perhaps RakuAST with it's support for deparsing may make that easier? Alternatively, could subset syntax be extended to take an additional (optional) field containing a String describing the constraint (which then gets printed in the exception if it's there)? Thoughts? |
|
@0racle isnt that kind of the intent of |
It is. I'm closing this issue as resolved. |
|
@0racle thanks for unearthing this one! :) |
The Problem
When the constraint in a where clause is not met, it says
expected anonymous constraint to be metExpected Behavior
It would be better if there was some way of fleshing out
anonymous constraintby printing the signature or the actual anonymous constraint. Or some way of making the constraints not anonymous and print the actual name of the constraint.Environment
This is perl 6 2018.05
The text was updated successfully, but these errors were encountered: