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

internal error: environment misses: on default value for generic function #20916

Closed
arnetheduck opened this issue Nov 25, 2022 · 1 comment · Fixed by #24065
Closed

internal error: environment misses: on default value for generic function #20916

arnetheduck opened this issue Nov 25, 2022 · 1 comment · Fixed by #24065

Comments

@arnetheduck
Copy link
Contributor

arnetheduck commented Nov 25, 2022

What happened?

type
  SomeX = object
    v: int


proc f(_: type int, x: SomeX, v = x.v) =
  echo v

proc a(): proc() =
  let v = SomeX(v: 42)
  var tmp = proc() =
    int.f(v)
  tmp

a()()
testit.nim(6, 35) Error: internal error: environment misses: x

Nim Version

1.6.8

Current Standard Output Logs

No response

Expected Standard Output Logs

No response

Possible Solution

No response

Additional Information

No response

@bung87
Copy link
Collaborator

bung87 commented Aug 11, 2023

v = x.v this part is not implemented, neither in lambda lifting nor proc declaration. not certain.

metagn added a commit to metagn/Nim that referenced this issue Sep 6, 2024
@Araq Araq closed this as completed in a93c5d7 Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants