remove panic in constrain/src/pattern

This commit is contained in:
Folkert 2020-03-30 15:03:05 +02:00
parent 503486f5bb
commit e05bad3c72
2 changed files with 16 additions and 18 deletions

View file

@ -117,9 +117,10 @@ pub fn constrain_pattern(
state: &mut PatternState,
) {
match pattern {
Underscore | UnsupportedPattern(_) => {
Underscore | UnsupportedPattern(_) | Shadowed(_, _) => {
// Neither the _ pattern nor erroneous ones add any constraints.
}
Identifier(symbol) => {
state.headers.insert(
symbol.clone(),
@ -271,8 +272,5 @@ pub fn constrain_pattern(
state.constraints.push(whole_con);
state.constraints.push(tag_con);
}
Shadowed(_, _) => {
panic!("TODO constrain Shadowed pattern");
}
}
}

View file

@ -289,22 +289,22 @@ mod test_report {
)
}
// #[test]
// fn report_shadow() {
// report_problem_as(
// indoc!(
// r#"
// i = 1
// #[test]
// fn report_shadow() {
// report_problem_as(
// indoc!(
// r#"
// i = 1
//
// s = \i ->
// i + 1
// s = \i ->
// i + 1
//
// s i
// "#
// ),
// indoc!(r#" "#),
// )
// }
// s i
// "#
// ),
// indoc!(r#" "#),
// )
// }
// #[test]
// fn report_unsupported_top_level_def() {