nim-lang / nim-mode

An emacs major mode for the Nim programming language
138 stars 46 forks source link

nimsuggest wrong-type-argument stringp #160

Closed kaushalmodi closed 7 years ago

kaushalmodi commented 7 years ago

This is probably related to https://github.com/nim-lang/nim-mode/issues/154 but am not 100% sure.

For this simple code where I was experimenting with noSideEffect:

proc sum(x, y:int): int {. noSideEffect .} =
  echo x # causes side effect
  x + y

echo sum(2,3)

I get this in the *Messages* buffer instead of having that error show up in *Flycheck errors* buffer.

Error from syntax checker nim-nimsuggest: (wrong-type-argument stringp ((chk skUnknown nil /home/kmodi/sandbox/nim/sideeffectchecking.nim Error 1 5 'sum' can have side effects 0)))




Some more digging:

So the problem is somewhere in flycheck-nimsuggest.el.

kaushalmodi commented 7 years ago

The Invalid face issue discussion moved to a separate issue: https://github.com/nim-lang/nim-mode/issues/161

kaushalmodi commented 7 years ago

This issue does in fact become the exact same as https://github.com/nim-lang/nim-mode/issues/154 if I remove the {. noSideEffect .} pragma from the code:

proc sum(x, y:int): int =
  echo x # causes side effect
  x + y

echo sum(2,3)