Allow multiple case branches to have a higher rank type

As #18412 points out, it should be OK for multiple case alternatives
to have a higher rank type, provided they are all the same.

This patch implements that change.  It sweeps away
GHC.Tc.Gen.Match.tauifyMultipleBranches, and friends, replacing it
with an enhanced version of fillInferResult.

The basic change to fillInferResult is to permit the case in which
another case alternative has already filled in the result; and in
that case simply unify.  It's very simple actually.

See the new Note [fillInferResult].
23 jobs for !3674 with wip/T18412 in 351 minutes and 24 seconds (queued for 3 seconds)
detached
Status Job ID Name Coverage
  Lint
passed #390822
lint
ghc-linters

00:00:14

passed #390823
lint
lint-linters

00:00:15

passed #390826
lint
lint-submods

00:00:22

passed #390824
lint
lint-testsuite

00:00:16

passed #390825
lint
typecheck-testsuite

00:00:15

 
  Quick Build
passed #390827
x86_64-linux
hadrian-ghc-in-ghci

00:11:52

 
  Build
passed #390828
x86_64-linux
validate-x86_64-linux-deb9-hadrian

01:38:08

 
  Full Build
failed #390831
aarch64-linux allowed to fail
validate-aarch64-linux-deb9

03:35:03

failed #390832
armv7-linux allowed to fail
validate-armv7-linux-deb9

03:21:43

passed #390833
x86_64-linux
validate-i386-linux-deb9

01:32:11

failed #390840
new-x86_64-windows test allowed to fail
validate-i386-windows

00:00:41

passed #390830
x86_64-darwin
validate-x86_64-darwin

01:09:07

passed #390834
x86_64-linux
validate-x86_64-linux-deb9-debug

01:48:40

passed #390836
x86_64-linux
validate-x86_64-linux-deb9-dwarf

01:57:51

passed #390835
x86_64-linux
validate-x86_64-linux-deb9-integer-simple

00:40:54

passed #390829
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian

02:47:09

passed #390837
x86_64-linux
validate-x86_64-linux-fedora27

01:29:52

failed #390839
new-x86_64-windows test allowed to fail
validate-x86_64-windows

00:29:30

failed #390838
new-x86_64-windows test allowed to fail
validate-x86_64-windows-hadrian

03:20:08

 
  Cleanup
passed #390841
x86_64-darwin
cleanup-darwin

00:00:14

 
  Packaging
failed #390842
x86_64-linux allowed to fail
doc-tarball

00:01:17

 
  Testing
manual #390843
x86_64-linux allowed to fail manual
hackage
passed #390844
x86_64-linux
perf-nofib

00:23:49

 
Name Stage Failure
failed
validate-i386-windows Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=7492 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
validate-x86_64-windows Full Build
Git branch:   13-1-stable
GO version: go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=4608 revision=6214287e version=13.1.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
validate-aarch64-linux-deb9 Full Build
Uploading artifacts...
ghc-aarch64-linux-deb9.tar.xz: found 1 matching files

junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=390831 responseStatus=201 Created token=KP_KXTE2
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=390831 responseStatus=201 Created token=KP_KXTE2
ERROR: Job failed: exit code 1
failed
validate-armv7-linux-deb9 Full Build
Uploading artifacts...
ghc-armv7-linux-deb9.tar.xz: found 1 matching files

junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=390832 responseStatus=201 Created token=hHsym9_V
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=390832 responseStatus=201 Created token=hHsym9_V
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows-hadrian Full Build
GO version:   go1.13.8
Built: 2020-06-19T21:12:23+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=5872 revision=6214287e version=13.1.0
junit.xml: found 1 matching files and directories

WARNING: Failed to load system CertPool: crypto/x509: system root pool is not available on Windows
Uploading artifacts as "junit" to coordinator... ok
id=390838 responseStatus=201 Created token=JhyxpQns
ERROR: Job failed: exit status 1
failed
doc-tarball Packaging
Entering 'utils/haddock'
Entering 'utils/hsc2hs'
Downloading artifacts
Downloading artifacts for validate-x86_64-linux-deb9-debug (390834)...
Downloading artifacts from coordinator... ok
id=390834 responseStatus=200 OK token=TqmdVMs1
Executing "step_script" stage of the job script
$ if [ ! -f "$LINUX_BINDIST" ]; then # collapsed multi-line command
Error: ghc-x86_64-mingw32.tar.xz does not exist. Did the 64-bit Windows job fail?
ERROR: Job failed: exit code 1