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

Error message around <bytes>.decode(...) mention hilti::Charset #1803

Closed
awelzel opened this issue Jul 17, 2024 · 1 comment · Fixed by #1902
Closed

Error message around <bytes>.decode(...) mention hilti::Charset #1803

awelzel opened this issue Jul 17, 2024 · 1 comment · Fixed by #1902
Assignees

Comments

@awelzel
Copy link
Contributor

awelzel commented Jul 17, 2024

I thought there were some changes that hilti::Charset isn't supposed to be used anymore. Two observations:

  1. Mistakenly typing bytes.decode("utf-8") shows a lot of hilti::Charset for me:
[error] ldap/ldap.spicy:987:53-987:70: call does not match any method: <bytes>.decode(<string>)
[error] ldap/ldap.spicy:987:53-987:70:   candidates:
[error] ldap/ldap.spicy:987:53-987:70:   - <bytes>.decode([charset: hilti::Charset = hilti::Charset::UTF8], [errors: hilti::DecodeErrorStrategy = hilti::DecodeErrorStrategy::REPLACE])
  1. It seems import hilti works still?
$ cat h.spicy 
module Test;

import hilti;

print b"abc".decode(hilti::Charset::UTF8);
$ spicyc -j h.spicy -o h.hlto
$ spicyc --version
spicyc v1.11.0-dev.262 (4a1b43ef)

Am I confused? :-)

@rsmmr
Copy link
Member

rsmmr commented Jul 22, 2024

Both of these are a result of the layering, where things get lowered from Spicy to HILTI internally, and doing "HILTI stuff" ends up working as well, and error messages may be produced at the HILTI level (where spicy::Charset has turned into hilti::Charset). But yeah, we should try to make this nicer.

@rsmmr rsmmr self-assigned this Oct 16, 2024
rsmmr added a commit that referenced this issue Oct 18, 2024
We now show them with a `spicy` prefix, which makes more sense for
users.

Closes #1803.
rsmmr added a commit that referenced this issue Oct 18, 2024
We now show them with a `spicy` prefix, which makes more sense for
users.

Closes #1803.
@rsmmr rsmmr closed this as completed in a76f920 Oct 24, 2024
rsmmr added a commit that referenced this issue Oct 24, 2024
* origin/topic/robin/gh-1803-no-hilti:
  Fix namespacing of `hilti` IDs in Spicy-side diagnostic output.
  Add printer plugin hook to customize ID printing.
  Add scope guard utility class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants