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

Exported converters cause havoc. #38

Open
beef331 opened this issue Nov 18, 2021 · 4 comments
Open

Exported converters cause havoc. #38

beef331 opened this issue Nov 18, 2021 · 4 comments

Comments

@beef331
Copy link

beef331 commented Nov 18, 2021

I just spent 10-20 minutes to hunt down why I could not echo a byte, which is cause of

converter toInt*(x: uint8): int = int(x)
. This should be behind a flag or removed in my view. To see the fun error message you get due to it consider the following.

converter toInt*(x: uint8): int = int(x)
echo 10u8
``
@Vladar4
Copy link
Owner

Vladar4 commented Nov 20, 2021

bef9a61 should help. Please check and let me know.

@beef331
Copy link
Author

beef331 commented Nov 21, 2021

That will not resolve the issue as converters bubble up. For example the following still errors.

# Module c
converter toInt*(x: uint8): int = int(x)
proc `$`*(x: uint8): string {.raises: [].} =
  result.addInt(int(x))

# Module b
import c

# Module a
import b
echo 10u8

@krux02
Copy link
Contributor

krux02 commented Nov 21, 2021

looks to me like a Nim bug that needs a workaround.

@Vladar4
Copy link
Owner

Vladar4 commented Nov 21, 2021

Confirmed regression

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

3 participants