[fine] Clean up warnings

This commit is contained in:
John Doty 2024-02-04 20:22:31 -08:00
parent a8ab907eee
commit 1cc5ce6ca9

View file

@ -2038,7 +2038,7 @@ pub fn check(s: &Semantics) {
TreeKind::Pattern => check_pattern(s, tree),
TreeKind::WildcardPattern => {}
TreeKind::MatchArm => check_match_arm(s, tree),
TreeKind::MatchArm => {}
TreeKind::MatchBody => check_match_body(s, t, tree),
TreeKind::MatchExpression => {}
}
@ -2236,23 +2236,23 @@ fn check_pattern(s: &Semantics, tree: &Tree) {
}
}
fn check_match_body(s: &Semantics, t: TreeRef, tree: &Tree) {
fn check_match_body(s: &Semantics, t: TreeRef, _tree: &Tree) {
let _ = s.type_of(t); // Checks arm count and compatibility.
let arms: Vec<_> = tree
.children_of_kind(s.syntax_tree, TreeKind::MatchArm)
.collect();
// TODO: completeness checks
if arms.len() > 0 {
for arm in &arms[1..] {
// TODO: How do I know if it's complete?
// TODO: How do I know if it's redundant?
}
}
// let arms: Vec<_> = tree
// .children_of_kind(s.syntax_tree, TreeKind::MatchArm)
// .collect();
// if arms.len() > 0 {
// for arm in &arms[1..] {
// // TODO: How do I know if it's complete?
// // TODO: How do I know if it's redundant?
// }
// }
}
fn check_match_arm(s: &Semantics, tree: &Tree) {}
#[cfg(test)]
mod tests {
use super::*;