diff --git a/src/can/operator.rs b/src/can/operator.rs index 1a1b13bd9d..97160b421d 100644 --- a/src/can/operator.rs +++ b/src/can/operator.rs @@ -3,7 +3,7 @@ use bumpalo::Bump; use operator::BinOp::Pizza; use operator::{BinOp, CalledVia}; use parse::ast::Expr::{self, *}; -use parse::ast::{AssignedField, Def, Pattern}; +use parse::ast::{AssignedField, Def}; use region::{Located, Region}; use types; @@ -322,45 +322,7 @@ pub fn desugar<'a>(arena: &'a Bump, loc_expr: &'a Located>) -> &'a Loca }), ) } - If((condition, then_branch, else_branch)) => { - // desugar if into case, meaning that - // - // if b then x else y - // - // becomes - // - // case b of - // False -> y - // _ -> x - let mut branches = Vec::with_capacity_in(2, arena); - - // no type errors will occur here so using this region should be fine - let pattern_region = condition.region.clone(); - - branches.push(&*arena.alloc(( - Located { - value: Pattern::Variant(&[], "False"), - region: pattern_region, - }, - (*else_branch).clone(), - ))); - - branches.push(&*arena.alloc(( - Located { - value: Pattern::Underscore, - region: pattern_region, - }, - (*then_branch).clone(), - ))); - - desugar( - arena, - arena.alloc(Located { - value: Case(condition, branches), - region: loc_expr.region, - }), - ) - } + other => panic!("TODO desugar {:?}", other), } } diff --git a/tests/test_infer.rs b/tests/test_infer.rs index 5d7844e940..de605be199 100644 --- a/tests/test_infer.rs +++ b/tests/test_infer.rs @@ -611,21 +611,6 @@ mod test_infer { ); } - // #[test] - // fn if_with_int_literals() { - // infer_eq( - // indoc!( - // r#" - // if 1 == 1 then - // 42 - // else - // 24 - // "# - // ), - // "Int", - // ); - // } - #[test] fn case_with_int_literals() { infer_eq(