-
Notifications
You must be signed in to change notification settings - Fork 1
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
Supers are not lazily evaluated #11
Comments
That sounds like a bug indeed: the list of supers should be eagerly evaluated to resolve the multiple inheritance hierarchy, but the fields of the super itself shouldn't. Maybe the bug though isn't in the super handling, but in the casting of prototype-less record to pop prototype? Even then that would be a bug, but a different one. |
I dont think so, I just used the plain attribute set as an example, but it happens even if that attrset was wrapped in a pop.lib.pop { supers = [ (kPop { a = throw "err"; b = 5; }) ]; } Also errors out. |
@fare Are there any inquiries pertaining to this matter? I also got the same problem when I trying embed POP into my instance. Thanks |
I opened this NixOS/nix#8364 |
https://twitter.com/Ngnghm/status/1717684526720094339 Lacking the ability to compare structures or functions by pointer identity, or system-provided nonces as identity tags, the only reliable solution is user-provided labels with some naming conventions to retrieve some modularity. |
Akshully, we might be able to do proper pointer equality: https://code.tvl.fyi/about/tvix/docs/value-pointer-equality.md |
Yeah I just saw that thread! I might give that a try to see if we can fix this issue. I tried something similar with lists which sometimes worked, so hopefully this trick will work fully. |
Note that one part of the problem is ensuring that |
An attribute in a pop containing an error shouldn't error out the entire pop. Other attributes should still be accessible even if one attribute errors out.
The following code should print out
5
, but it would just error out now.cc @fare
The text was updated successfully, but these errors were encountered: