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

Open
geekrelief opened this issue Oct 27, 2021 · 1 comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants