-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
A-resolveProposals relating to name resolution.Proposals relating to name resolution.A-syntaxSyntax related proposals & ideasSyntax related proposals & ideasT-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
RFC PR #132 (UFCS) had many descriptions of various paths, but completely omitted concrete examples of an actual method call (with the receiver expression and the arguments) written via the proposed notation.
In particular, assuming a trait ToStr { fn to_str(&self) -> String }
and type S
that implements ToStr
and also has its own impl S { fn to_str(&self, max: uint) -> String }
are we expecting to be able to write:
fn f(s: &S) -> String { s.ToStr::to_str() }
, orfn f(s: &S) -> String { ToStr::to_str(s) }
, or- both?
and likewise:
fn g(s: &S) -> String { s.<S>::to_str(10) }
, orfn g(s: &S) -> String { <S>::to_str(s, 10) }
, or- both?
(Perhaps the answer is implied by some other document that specifies whether method call expressions use a full path for the method name, or just an identifier and optional generics args list ::<T, U, ...>
. Nonetheless this detail is important enough to go into the document itself.)
Metadata
Metadata
Assignees
Labels
A-resolveProposals relating to name resolution.Proposals relating to name resolution.A-syntaxSyntax related proposals & ideasSyntax related proposals & ideasT-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.