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

nimpretty adds spaces where it shouldn't #11470

Closed
narimiran opened this issue Jun 10, 2019 · 0 comments

Comments

@narimiran
Copy link
Member

commented Jun 10, 2019

Examples from Nim stdlib:

Example

assert $type(a) == "Option[system.int]"
foo(a, $type(b), c)
foo($type(b), c) # this is ok

proc `<`*[A](s, t: A): bool = discard
proc `==`*[A](s, t: HashSet[A]): bool = discard
proc `<=`*[A](s, t: HashSet[A]): bool = discard

# these are ok:
proc `$`*[A](s: HashSet[A]): string = discard
proc `*`*[A](s1, s2: HashSet[A]): HashSet[A] {.inline.} = discard
proc `-+-`*[A](s1, s2: HashSet[A]): HashSet[A] {.inline.} = discard

Current Output

assert $ type(a) == "Option[system.int]"
foo(a, $ type(b), c)
foo($type(b), c)              # this is ok

proc ` < `*[A](s, t: A): bool = discard
proc ` == `*[A](s, t: HashSet[A]): bool = discard
proc ` <= `*[A](s, t: HashSet[A]): bool = discard

# these are ok:
proc `$`*[A](s: HashSet[A]): string = discard
proc `*`*[A](s1, s2: HashSet[A]): HashSet[A] {.inline.} = discard
proc `-+-`*[A](s1, s2: HashSet[A]): HashSet[A] {.inline.} = discard

Expected Output

The same as input, no changes.

Additional Information

$ nim -v
Nim Compiler Version 0.20.0 [Linux: amd64]

@narimiran narimiran added the nimpretty label Jun 10, 2019

@Araq Araq closed this in 165ea46 Jun 13, 2019

narimiran added a commit to narimiran/Nim that referenced this issue Jun 16, 2019

[bugfix] nimpretty: fixes nim-lang#11470
(cherry picked from commit 165ea46)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.