Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> We give @fieldParentPtr the name of the field, a pointer to that field as well as a return type (which is inferred above by the assignment to a *User variable), and it gives us back the instance that contains that field.

That seems like a refactoring nightmare. If I say:

    const user: *NotAUser = @fieldParentPtr("node", n);
Will it calculate this incorrectly? I mean, if `NotAUser` has a "node" field and `n` is actually from the `User` type (and it has a different offset in each type)?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: