[Regression | Typechecker] Switch cases have become far less strict
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
### HHVM Version
HipHop VM 4.15.0 (rel)
Compiler: 1563823444_067594131
Repo schema: 55936598ef25c809003ec394e52b0d26b3121f31
hackc-78d2293bfefbe359ca775387521e434d0acea352-4.15.0
### Operating System and Version
Ubuntu 18.04
### Standalone code, or other way to reproduce the problem
```HACK
enum Strings: string {
key = 'value';
}
<<__EntryPoint>>
function main(): noreturn {
switch ('a string') {
case Strings::key:
echo 'This is a typecheck time mismatch.';
}
switch (1) {
case Strings::key:
echo
'This is both a typecheck type mismatch and a runtime type mismatch.';
}
switch (1) {
case '1 string':
echo 'I would coerce at runtime';
}
exit();
}
```
### Actual result
hh_client `No errors!`
### Expected result
Complain about switch type mismatch.
Contributor guide
Assessment
This issue has not been assessed yet.