DsymbolExp.resolve converts a D symbol to corresponding expression object.
In DotIdExp.semanticY, if eright.op == TOKimport, the found symbol is converted to corresponding expression object with the 'eleft' context.
They're doing similar work, but they are not yet enough consistent. Issue 14858, issue 15116, issue 15117, and issue 15310 (14603 and 14604) have been caused by the inconsistency between them.
I think, DsymbolExp.resolve should take one more parameter 'eleft', and if it's not null, it should work like DotIdExp.semanticY.
Comment #1 by razvan.nitu1305 — 2022-10-13T08:13:56Z
DsymbolExp.resolve is named symbolToExp now and its implementation has diverged significantly from semanticY. As such, this bug report is no longer relevant.