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

--declaredlocs now shows location for T instead of static in proc fn(a: static T) #17795

Merged
merged 2 commits into from
Apr 23, 2021

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Apr 20, 2021

example

when true:
  proc fn(a: static string) = discard
  fn(2)

nim r --declaredlocs --filenames:canonical /pathto/t12190.nim

before PR

tests/nim/all/t12190.nim(7, 5) Error: type mismatch: got <int literal(2)>
but expected one of:
proc fn(a: static string) [proc declared in tests/nim/all/t12190.nim(6, 8)]
  first type mismatch at position: 1
  required type for a: static[string] [static declared in tests/nim/all/t12190.nim(6, 11)]
  but expression '2' is of type: int literal(2) [int declared in system/basic_types.nim(2, 3)]

after PR

tests/nim/all/t12190.nim(7, 5) Error: type mismatch: got <int literal(2)>
but expected one of:
proc fn(a: static string) [proc declared in tests/nim/all/t12190.nim(6, 8)]
  first type mismatch at position: 1
  required type for a: static[string] [string declared in system.nim(34, 3)]
  but expression '2' is of type: int literal(2) [int declared in system/basic_types.nim(2, 3)]

note

the fact that it shows absolute paths despite --listfullpaths:off is a pre-existing issue with --listfullpaths:off and is being fixed in #17746 EDIT: fixed in #17746

@timotheecour timotheecour force-pushed the pr_declaredLocs_skiptypes branch from c7f546b to 2979ee5 Compare April 23, 2021 20:27
@Araq Araq merged commit 80df21d into nim-lang:devel Apr 23, 2021
@timotheecour timotheecour deleted the pr_declaredLocs_skiptypes branch April 23, 2021 21:30
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
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

Successfully merging this pull request may close these issues.

2 participants