Skip to content

Conversation

@timotheecour
Copy link
Member

@timotheecour timotheecour commented Apr 27, 2021

improve Example 3 from #16178

block:
  let a = bad5(1)

XDG_CONFIG_HOME= nim check --spellsuggest:0 --hints:off --filenames:canonical $timn_D/tests/nim/all/t12213.nim

before PR

tests/nim/all/t12213.nim(8, 13) Error: undeclared identifier: 'bad5'
tests/nim/all/t12213.nim(8, 17) Error: attempting to call routine: 'bad5'
  found 'bad5' [unknown declared in tests/nim/all/t12213.nim(8, 13)]
tests/nim/all/t12213.nim(8, 17) Error: attempting to call routine: 'bad5'
  found 'bad5' [unknown declared in tests/nim/all/t12213.nim(8, 13)]
tests/nim/all/t12213.nim(8, 17) Error: expression 'bad5' cannot be called
tests/nim/all/t12213.nim(8, 17) Error: expression '' has no type (or is ambiguous)
tests/nim/all/t12213.nim(8, 9) Error: 'let' symbol requires an initialization

after PR

tests/nim/all/t12213.nim(8, 13) Error: undeclared identifier: 'bad5'
tests/nim/all/t12213.nim(8, 17) Error: expression '' has no type (or is ambiguous)
tests/nim/all/t12213.nim(8, 9) Error: 'let' symbol requires an initialization

note

if you have a concrete idea for how to avoid when defined(nimsuggest): ... I'm all ears, otherwise the change is good enough for now

future work

  • use errorSubNode or newError(which uses the new nkError) instead of errorNode (which uses nkEmpty) so that we can also remove the 2nd and 3rd line; as explained in PR; this is a bigger change so can be done in future work (it's already hard enough because it interferes with nimsuggest)

@timotheecour timotheecour added the TODO: followup needed remove tag once fixed or tracked elsewhere label Apr 27, 2021
@timotheecour timotheecour changed the title nim check: make error msgs less redundant; testament: add nimoutfull: bool spec nim check: make error msgs less redundant Apr 27, 2021
@timotheecour timotheecour force-pushed the pr_nimcheck_redundant_undeclared branch 2 times, most recently from fff0585 to 6858014 Compare April 27, 2021 23:58
@timotheecour timotheecour marked this pull request as ready for review April 28, 2021 01:25
@timotheecour timotheecour added the Ready For Review (please take another look): ready for next review round label Apr 28, 2021
@Araq
Copy link
Member

Araq commented Apr 29, 2021

if you have a concrete idea for how to avoid when defined(nimsuggest): ... I'm all ears, otherwise the change is good enough for now

I don't have an idea either but it's not "good enough for now", hacks like these live on for much too long in general and slow down development.

@timotheecour timotheecour removed the Ready For Review (please take another look): ready for next review round label Apr 29, 2021
@timotheecour timotheecour force-pushed the pr_nimcheck_redundant_undeclared branch from 4a65661 to 75bbbdf Compare July 20, 2021 19:48
@timotheecour timotheecour marked this pull request as draft July 20, 2021 21:24
@timotheecour timotheecour force-pushed the pr_nimcheck_redundant_undeclared branch from 75bbbdf to f5d8be1 Compare July 25, 2021 19:47
@timotheecour timotheecour force-pushed the pr_nimcheck_redundant_undeclared branch from f5d8be1 to 72d5c3f Compare July 25, 2021 19:51
@Araq Araq closed this Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TODO: followup needed remove tag once fixed or tracked elsewhere

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants