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

Misplaced export marker '*' on generic iterator produces wrong error message. #19063

Closed
geekrelief opened this issue Oct 27, 2021 · 2 comments · Fixed by #24525
Closed

Misplaced export marker '*' on generic iterator produces wrong error message. #19063

geekrelief opened this issue Oct 27, 2021 · 2 comments · Fixed by #24525

Comments

@geekrelief
Copy link
Contributor

geekrelief commented Oct 27, 2021

I'm running off devel.

In the code sample below I incorrectly exported items[T]* when it should be items*[T]. And Nim reports: Error: iterator needs a return type.

iterator items[T]*(s: seq[T]): T = # Error: iterator needs a return type
  for i in  system.items(s):
    yield i

It should say Error: invalid indentation; an export marker '*' follows the declared identifier. Nim correctly reports the error for procs and types in the sample below.

#type SomeOtherObject[T]* = object
proc test[T]*(a: T) = echo a.repr
@ynfle
Copy link
Contributor

ynfle commented Oct 28, 2021

Using nim check yields the intended error, but only as the third one, which is why it doesn't show up

@metagn
Copy link
Collaborator

metagn commented Nov 9, 2024

Both give same error now

metagn added a commit to metagn/Nim that referenced this issue Dec 8, 2024
@Araq Araq closed this as completed in aeb3fe9 Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants