hhvm / hhast

Mutable AST library for Hack with linting and code migrations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GroupUseStatementLinter does not work correctly with namespace blocks

fredemmott opened this issue · comments

in.hack

namespace Foo {
  use type SomeOtherNS\Herp;
  use type SomeOtherNS\Derp;
  function do_stuff(Herp $_, Derp $_): void {}
}

namespace Bar {
  use type SomeOtherNS\Herp;
  use type SomeOtherNS\Derp;
  function do_stuff(Herp $_, Derp $_): void {}
}

out.hack

namespace Foo {
  use type SomeOtherNS\{Derp, Herp};
  function do_stuff(Herp $_, Derp $_): void {}
}

namespace Bar {
  function do_stuff(Herp $_, Derp $_): void {}
}

problem

Herp and Derp are no longer usable in namespace Bar