FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.

Home Page:https://fuellabs.github.io/sway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eliminate `Items::use_aliases`

jjcnn opened this issue · comments

commented

Aliased imports, e.g.

use a::b as c;

are currently represented using two maps:

  • Items::use_synonyms, which maps b to the declaration of b in module a.
  • Items::use_aliases, which maps a to the name b.

There really is no reason two have both maps, since the name b is not in scope when using an aliased import.

commented

Related to this, aliased imports are not reexported correctly:

import x::y; // this gets reexported as y
import z::w as v; // this does not get reexported, neither as w nor as v

Eliminating use_aliases and only binding the aliased name should fix this issue.