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

wrong sink parameter passing #14207

Closed
Araq opened this issue May 3, 2020 · 0 comments
Closed

wrong sink parameter passing #14207

Araq opened this issue May 3, 2020 · 0 comments

Comments

@Araq
Copy link
Member

Araq commented May 3, 2020

Function b outputs the wrong string.

Example

proc takeSink(x: sink string): bool = true

proc b(x: sink string): string =
  if takeSink(x):
    return x & "abc"

proc main(inp: string) =
  let y = inp & "xyz"
  echo b(y)

main("123")
Araq added a commit that referenced this issue May 3, 2020
@Araq Araq closed this as completed in b6fb609 May 4, 2020
narimiran pushed a commit that referenced this issue May 6, 2020
…1.2]

* destructors: don't produce stupid code for 'cast'

* fixes #14207

(cherry picked from commit b6fb609)
EchoPouet pushed a commit to EchoPouet/Nim that referenced this issue Jun 13, 2020
…ackport:1.2]

* destructors: don't produce stupid code for 'cast'

* fixes nim-lang#14207
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant