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

bootstrap: Error: internal error: environment misses: s #521

Open
timotheecour opened this issue Jan 13, 2021 · 0 comments
Open

bootstrap: Error: internal error: environment misses: s #521

timotheecour opened this issue Jan 13, 2021 · 0 comments

Comments

@timotheecour
Copy link
Owner

timotheecour commented Jan 13, 2021

in nim-lang#16699

$nim_csources_local_X c -r compiler/nim
(0.20.0)

/Users/timothee/git_clone/nim/Nim_prs/compiler/lexer.nim(1084, 31) template/generic instantiation from here
/Users/timothee/git_clone/nim/Nim_prs/lib/pure/strutils.nim(1457, 56) Error: internal error: environment misses: s
    func dedent*(s: string, count: Natural = indentation(s)): string =
                                                         ^

note

it's not clear yet how to minimize this because these work fine:

when defined case1:
  proc bar(a: int): int = a
  proc fn(a: int, b = bar(a)) = discard
  fn(2)
when defined case3:
  import std/strutils
  echo dedent("foo")

workaround:

proc dedent(a: string): string =
  # pending https://github.com/timotheecour/Nim/issues/521
  let b = a
  let i = indentation(b)
  dedent(a, i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant