-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
T-langRelevant to the language teamRelevant to the language team
Description
struct S(u8);
type Z = S;
fn main() {
match S(80) {
S(x) => {} // ok
}
match S(90) {
Z(x) => {} // error: unresolved enum variant, struct or const `Z` [E0419]
}
}
For some reason names of tuple struct/variant patterns are searched for in the value namespace and not in the type namespace.
This is strange, because S here is a name of the type, not constructor function, and S(x) is not a function call.
S and Z should probably be searched in the type namespace, like names of struct patterns S{..}.
Theoretically such change can break code, but only in highly contrived cases.
@jseyfried @nrc what do you think?
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language teamRelevant to the language team