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

[Regression] Borrow stringify operator no longer works as expected #9322

Closed
cooldome opened this Issue Oct 11, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@cooldome
Copy link
Member

cooldome commented Oct 11, 2018

The following code snippet no longer compiles:

type Fix = distinct string

proc `$`(f: Fix): string {.borrow.}

proc mystr(s: string) =
  echo s

mystr($Fix("apr"))

Compile error is strange as if compiler ignores $ operator:

regression.nim(8, 6) Error: type mismatch: got <Fix>
but expected one of:
proc mystr(s: string)
@cooldome

This comment has been minimized.

Copy link
Member

cooldome commented Oct 11, 2018

Regression introduced in 8670f49

@LemonBoy , could you please have look?

@cooldome cooldome changed the title [Regression] Looks like constant folding issue for distinct types, but I am not sure [Regression] Borrow stringify operator no longer works as expected Oct 11, 2018

LemonBoy added a commit to LemonBoy/Nim that referenced this issue Oct 11, 2018

@Araq Araq closed this in #9323 Oct 12, 2018

Araq added a commit that referenced this issue Oct 12, 2018

Araq added a commit that referenced this issue Nov 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment