diff options
| author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-02-19 19:36:48 +0100 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-01 17:31:01 -0500 |
| commit | 3b79e8b833646e995f035e4402f2284cc15cbd72 (patch) | |
| tree | dd0585c05c3a4f565a51f3f06019cf75a9add352 /compiler | |
| parent | 7730713b747e66c93b4fe45478981a6e2ebfc7e2 (diff) | |
| download | haskell-3b79e8b833646e995f035e4402f2284cc15cbd72.tar.gz | |
Infer multiplicity in case expressions
This is a first step towards #18738.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/GHC/Tc/Gen/Expr.hs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/Gen/Expr.hs b/compiler/GHC/Tc/Gen/Expr.hs index dfb9d6abd9..dc0d244fc1 100644 --- a/compiler/GHC/Tc/Gen/Expr.hs +++ b/compiler/GHC/Tc/Gen/Expr.hs @@ -372,9 +372,7 @@ tcExpr (HsCase x scrut matches) res_ty -- -- But now, in the GADT world, we need to typecheck the scrutinee -- first, to get type info that may be refined in the case alternatives - let mult = Many - -- There is not yet syntax or inference mechanism for case - -- expressions to be anything else than unrestricted. + mult <- newFlexiTyVarTy multiplicityTy -- Typecheck the scrutinee. We use tcInferRho but tcInferSigma -- would also be possible (tcMatchesCase accepts sigma-types) |
