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

prependMoved failed at compile time #17144

Closed
ringabout opened this issue Feb 22, 2021 · 0 comments · Fixed by #17126
Closed

prependMoved failed at compile time #17144

ringabout opened this issue Feb 22, 2021 · 0 comments · Fixed by #17126
Labels
VM see also `const` label

Comments

@ringabout
Copy link
Member

ringabout commented Feb 22, 2021

When diving into #17126, found this issue.

failed at Nim devel

import std/[lists, sequtils]

template main() =
  block:
    var
      l0 = initSinglyLinkedList[int]()
      l1 = [1].toSinglyLinkedList
      l2 = [2, 3].toSinglyLinkedList
      l3 = [4, 5, 6].toSinglyLinkedList
    l3.prependMoved l0
    l2.prependMoved l1

    doAssert l3.toSeq == [4, 5, 6]
    doAssert l2.toSeq == [1, 2, 3]
    l3.prepend l0
    doAssert l3.toSeq == [4, 5, 6]

static: main()
main()

Error: unhandled exception: D:\QQPCmgr\Desktop\Nim\test.nim(16, 14) l3gensym0.toSeq == [4, 5, 6]` [AssertionDefect]

Work at RT

> nim -v
Nim Compiler Version 1.5.1 [Windows: amd64]
Compiled at 2021-02-16
@ringabout ringabout added the VM see also `const` label label Feb 22, 2021
Araq pushed a commit that referenced this issue Mar 3, 2021
narimiran pushed a commit that referenced this issue Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this issue Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this issue Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this issue Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this issue Mar 18, 2021
(cherry picked from commit 6391f6e)
narimiran pushed a commit that referenced this issue Mar 18, 2021
(cherry picked from commit 6391f6e)
ringabout added a commit to ringabout/Nim that referenced this issue Mar 22, 2021
ardek66 pushed a commit to ardek66/Nim that referenced this issue Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VM see also `const` label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant