Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Values of path expressions #466

Open
mattheww opened this issue Nov 5, 2023 · 0 comments
Open

Values of path expressions #466

mattheww opened this issue Nov 5, 2023 · 0 comments

Comments

@mattheww
Copy link
Contributor

mattheww commented Nov 5, 2023

§6.3:5 (fls_5ifai8nkp5ek) says

The value of a path expression is the entity that it resolved to.

But the value of an expression needs to be a member of some type in the Rust type system, not an entity.

This section needs to cover each kind of entity that a path expression can resolve to, and explain how to use it to get a value or a place.

For example:

  • for a function, the value is the unique member of the corresponding function item type

  • for a constant, the value is obtained by evaluating the constant initializer

  • for a variable, we have a place expression representing the place in the current activation record which corresponds to that variable

I see a notion of "elaboration" is defined for constants, which seems to be what's needed here, but there's no text linking it to evaluating expressions that mention constants.

Similarly §6.3:4 (fls_cjywisyiyti6) says

The type of a path expression is the type of the entity that it resolved to.

But the section on Entities doesn't define the notion of an entity's type.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants