Stream: t-compiler/rust-analyzer

Topic: `support::child`

Jonas Schievink [he/him] (Jan 18 2021 at 14:44, on Zulip):

It seems to me that support::child will stop working correctly when something can contain multiple children of the same type. For example, LetStmt can contain several children that are MacroCalls: The pattern, the ascribed type, and the initializing expression.

It seems to work today, only because neither Pat nor Type have a MacroCall variant, only Expr does.

Is that right? Why has this not been a problem so far?

matklad (Jan 18 2021 at 14:48, on Zulip):

This analysis is correct!

matklad (Jan 18 2021 at 14:49, on Zulip):

I think we fix it manually in several select cases {for example, for impl trait/type}

matklad (Jan 18 2021 at 14:50, on Zulip):

I wonder if perhaps we should nest macro calls into specific nodes? MacroItem, MacroStmt, MacroExpr

Jonas Schievink [he/him] (Jan 18 2021 at 15:00, on Zulip):

Ah, we already do that for Pat, so I'll go for that

Last update: Jul 28 2021 at 03:00UTC