You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The section on Function Item Types (section 10.1.11 in stable branch as of Oct 26 2023) states:
When referred to, a function item, or the constructor of a tuple-like struct or enum variant, yields a zero-sized value of its function item type. That type explicitly identifies the function - its name, its type arguments, and its early-bound lifetime arguments (but not its late-bound lifetime arguments, which are only assigned when the function is called)
IMO the wording could be more explicit (and should include the return type?). Perhaps something like this:
A function item's type is defined by the function's name, the type and order of the its arguments, its return type, and its early-bound lifetime arguments. Late-bound lifetime arguments are not part of a function item's type since they are assigned when the function is called.
I'm not an expert by any means, so I don't know if the above description is correct or omits additional helpful information. For example, a statement about generics might be helpful. I presume they're not part of the type -- in which case a statement such as "Generics are not part of a function item's type since a function declared with generics is a template and not a function item - it becomes a function item when instantiated with specific types".
The text was updated successfully, but these errors were encountered:
alexttx
changed the title
Clarify how a type is constructed from a function item
Clarify how types are constructed from function items
Oct 26, 2023
The section on Function Item Types (section 10.1.11 in stable branch as of Oct 26 2023) states:
IMO the wording could be more explicit (and should include the return type?). Perhaps something like this:
I'm not an expert by any means, so I don't know if the above description is correct or omits additional helpful information. For example, a statement about generics might be helpful. I presume they're not part of the type -- in which case a statement such as "Generics are not part of a function item's type since a function declared with generics is a template and not a function item - it becomes a function item when instantiated with specific types".
The text was updated successfully, but these errors were encountered: