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: no symbol to borrow from found #4121

Open
yglukhov opened this issue Apr 27, 2016 · 4 comments
Open

Error: no symbol to borrow from found #4121

yglukhov opened this issue Apr 27, 2016 · 4 comments
Labels

Comments

@yglukhov
Copy link
Member

type HeapQueue[T] = distinct seq[T]
proc len*[T](h: HeapQueue[T]): int {.borrow.}
nim c test.nim
Hint: system [Processing]
Hint: test [Processing]
test.nim(2, 1) Error: no symbol to borrow from found
@Araq
Copy link
Member

Araq commented Apr 29, 2016

Yeah, known issue.

@gmpreussner
Copy link
Contributor

Upvote 👍

@gmpreussner
Copy link
Contributor

This also affects the lifting of built-in operators:

type
  Foo[T] = object
    a*: T

  Bar* {.borrow: `.`.} = distinct Foo[int]

var bb: Bar
echo bb.a  # Error: undeclared field: 'a'

In general, borrowing appears to be broken for all generic types.

@bung87
Copy link
Collaborator

bung87 commented Oct 26, 2022

This also affects the lifting of built-in operators:

type
  Foo[T] = object
    a*: T

  Bar* {.borrow: `.`.} = distinct Foo[int]

var bb: Bar
echo bb.a  # Error: undeclared field: 'a'

In general, borrowing appears to be broken for all generic types.

this works in current devel 3b973f3

bung87 added a commit to bung87/Nim that referenced this issue Nov 4, 2022
@bung87 bung87 mentioned this issue Nov 4, 2022
bung87 added a commit to bung87/Nim that referenced this issue Dec 29, 2022
bung87 added a commit to bung87/Nim that referenced this issue Jun 14, 2023
bung87 added a commit to bung87/Nim that referenced this issue Aug 9, 2023
bung87 added a commit that referenced this issue Aug 10, 2023
…0659)

* fix #19304 Borrowing std/times.format causes Error: illformed AST

* follow suggestions

* mitigate for #4121

* improve error message
narimiran pushed a commit that referenced this issue Apr 17, 2024
…0659)

* fix #19304 Borrowing std/times.format causes Error: illformed AST

* follow suggestions

* mitigate for #4121

* improve error message

(cherry picked from commit 2aab03b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants