You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HipHop VM 4.38.0-dev (rel)
Compiler: 1577504418_723705903
Repo schema: c0008085502abfa268d64b7193673709d52f0a0c
hackc-cc9cfe59f273bf16e25b5f524e7c7f044851ec5d-4.38.0-dev
Operating System and Version
Ubuntu 18.04
Standalone code, or other way to reproduce the problem
classSailPrivateUseProtected {
useRedeclareSailProtected;
privatenull$sail; // << Typing[4113] This member visibility is: private
}
classSailPrivateUsePublic {
useRedeclareSailPublic;
privatenull$sail; // << Typing[4113] This member visibility is: private
}
classSailProtectedUsePrivate {
useRedeclareSailPrivate;
protectednull$sail; // << Only fails at runtime
}
classSailProtectedUsePublic {
useRedeclareSailPublic;
protectednull$sail; // << Typing[4113] This member visibility is: protected
}
classSailPublicUsePrivate {
useRedeclareSailPrivate;
publicnull$sail; // << Only fails at runtime
}
classSailPublicUsePublic {
useRedeclareSailProtected;
publicnull$sail; // << Only fails at runtime
}
traitRedeclareSailPrivate {
privatenull$sail;
}
traitRedeclareSailProtected {
protectednull$sail;
}
traitRedeclareSailPublic {
publicnull$sail;
}
Actual result
Typing[4113] This member visibility is: private
--> file.hack
3 | private null $sail; // << Typing[4113] This member visibility is: private
| ^^^^
32 | protected null $sail;
| ^^^^ protected was expected
Typing[4113] This member visibility is: private
--> file.hack
7 | private null $sail; // << Typing[4113] This member visibility is: private
| ^^^^
35 | public null $sail;
| ^^^^ public was expected
Typing[4113] This member visibility is: protected
--> file.hack
16 | protected null $sail; // << Typing[4113] This member visibility is: protected
| ^^^^
35 | public null $sail;
| ^^^^ public was expected
3 errors found.
Expected result
All of these cases should generate an error, since they all fail at runtime with an error like:
Fatal error: Uncaught Error: trait declaration of property 'sail' is incompatible with previous declaration in file.hack:line
The text was updated successfully, but these errors were encountered:
The code that generates this error message can be found here.
lexidor
changed the title
[Typechecker] Missing typechecker error when properties in traits with stricter accessibility modifiers
[Typechecker] Missing typechecker error when redeclared properties in traits with stricter accessibility modifiers
Jan 2, 2020
HHVM Version
Operating System and Version
Ubuntu 18.04
Standalone code, or other way to reproduce the problem
Actual result
Expected result
All of these cases should generate an error, since they all fail at runtime with an error like:
The text was updated successfully, but these errors were encountered: