Skip to content

Commit 7ec5aaf

Browse files
committed
Fix renamed imports
1 parent 698808d commit 7ec5aaf

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/conversion/first.d

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,15 @@ final class FirstPass : ASTVisitor
366366
foreach (bind; importDeclaration.importBindings.importBinds)
367367
{
368368
Tuple!(string, string) bindTuple;
369-
bindTuple[0] = internString(bind.left.text);
370-
bindTuple[1] = bind.right == tok!"" ? null : internString(bind.right.text);
369+
if (bind.right == tok!"")
370+
{
371+
bindTuple[1] = internString(bind.left.text);
372+
}
373+
else
374+
{
375+
bindTuple[0] = internString(bind.left.text);
376+
bindTuple[1] = internString(bind.right.text);
377+
}
371378
info.importedSymbols.insert(bindTuple);
372379
}
373380
info.isPublic = protection == tok!"public";

src/conversion/second.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private:
171171

172172
foreach (tup; importInfo.importedSymbols[])
173173
{
174-
ACSymbol needle = ACSymbol(tup[0]);
174+
ACSymbol needle = ACSymbol(tup[1]);
175175
ACSymbol* sym;
176176
auto r = symbol.parts.equalRange(&needle);
177177
if (r.empty) foreach (sy; symbol.parts[])
@@ -187,9 +187,9 @@ private:
187187
sym = r.front;
188188
if (sym is null)
189189
continue;
190-
if (tup[1] !is null)
190+
if (tup[0] !is null)
191191
{
192-
ACSymbol* s = allocate!ACSymbol(symbolAllocator, tup[1],
192+
ACSymbol* s = allocate!ACSymbol(symbolAllocator, tup[0],
193193
sym.kind, sym.type);
194194
s.parts.insert(sym.parts[]);
195195
s.callTip = sym.callTip;

0 commit comments

Comments
 (0)