Stream: t-compiler/wg-diagnostics

Topic: trailing `>`

davidtwco (Jan 21 2019 at 22:59, on Zulip):

@Esteban K├╝ber I'm working on the Foo::<Bar>::Baz case: I've got something that works by calling our trailing > check after this line - however, as parse_path_segment can indirectly end up calling parse_path_segments (the function we're modifying), it causes some difficulty.

That is, given Foo::<Bar as Baz<T>>::Qux, we parse until Foo::< where it will call parse_path_segments and then our check directly afterwards. Parsing the inside of the <..> results in us getting to Foo::<Bar as Baz< when we end up calling parse_path_segments again and our check directly afterwards. When that call returns, we are at Foo::<Bar as Baz<T> and the check concludes that the correct > that follows is in fact trailing. What we want to happen is execute our check after parse_path_segments only on the first invocation and not on any subsequent recursions.

I've achieved this by checking if style == PathStyle::Expr - however, I'm not sure if it is an invariant of that style that it won't ever be used in a call from a recursion. Do you know if that is the case?

davidtwco (Jan 21 2019 at 23:44, on Zulip):

More concretely, see this review comment.

Last update: Apr 05 2020 at 01:45UTC