Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use type Bar\{Bar} treated differently to use type Bar\Bar #9335

Open
muglug opened this issue Feb 15, 2023 · 2 comments
Open

Use type Bar\{Bar} treated differently to use type Bar\Bar #9335

muglug opened this issue Feb 15, 2023 · 2 comments
Labels

Comments

@muglug
Copy link
Contributor

muglug commented Feb 15, 2023

Describe the bug
We see an unexpected error in the code below. Replacing use type Bar\{Bar}; with use type Bar\Bar; is a workaround for this issue.

Standalone code, or other way to reproduce the problem

namespace Foo;
  
use namespace Bar;
use type Bar\{Bar};

final class FooBar extends Bar {
   const Bar\my_type CONFIG = shape('a' => 'b');
}

namespace Bar;

abstract class Bar {
  const my_type CONFIG = shape('a' => 'b');
}

type my_type = shape('a' => string);

Steps to reproduce the behavior:
Run hh_client on the above

Expected behavior

No errors

Actual behavior

File "/root/foo.hack", line 6, characters 28-30:
Some members in class `Foo\FooBar` are incompatible with those declared in type `Bar\Bar` (Typing[4348])
  File "/root/foo.hack", line 13, characters 9-15:
  Expected `shape('a' => string)`
  File "/root/foo.hack", line 7, characters 10-20:
  But got `Bar\Bar\my_type`

Environment
Docker nightly

HipHop VM 6.33.0-dev (rel) (non-lowptr)
Compiler: 1676345911_402707174
Repo schema: 960a4d092e2e8175b8f0a3b2caecffb7c980c672

Additional context

Narrowed down to this breaking diff: e71e870...21598ba

@forms2772
Copy link

give chroma

@forms2772
Copy link

in blooket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants