Skip to content
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

(s)printf misleading error message should report values, not types #2724

Closed
Altreus opened this issue Mar 1, 2019 · 1 comment
Closed

(s)printf misleading error message should report values, not types #2724

Altreus opened this issue Mar 1, 2019 · 1 comment

Comments

@Altreus
Copy link

Altreus commented Mar 1, 2019

printf should report the value when it could not be applied to a directive; currently, it reports the type of the value.

> printf("%d",Inf)   
Directive d not applicable for type Num

This is misleading when the type is expected to work, but can have unworkable values; in the above example, it is surprising to hear that Num does not apply to d, whereas in fact it is Inf or NaN that don't apply to d.

Another misleading case is Str, since again it is the value that is unusable, not the type:

> printf("%d", "1")
1

> printf("%d", "raku")
Directive d not applicable for type Str
@lizmat
Copy link
Contributor

lizmat commented Mar 2, 2019

Thanks for the report. This is now fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants