Please sign in to comment.
Fix two typing issues in `Case` expressions:
- One-argument OptionMappers (as implemented by OptionMapper2) were not always inferred correctly. Setting the first base and mapped type to `Boolean` instead of asking for the desired type twice helps the type inferencer find the correct OptionMapper2. - `IfThenElse.nullExtend` was broken by design. We cannot reply on AST types in the Lifted Embedding DSL. Null-extending is now performed directly in `TypedCase` based on the embedding types. It also turns out to be much simpler than originally implemented in `nullExtend` because the typing rules of `Case` allow only three cases: Explicit `Else` clause -> use original types; missing `Else` and base type is an `Option` -> use original types; missing `Else` and base type is not an `Option` -> wrap *all* `Then` clauses in `OptionApply`. Fixes #1364. Test in RelationalMiscTest.testConditional.
- Loading branch information...
Showing with 17 additions and 9 deletions.