fix: pattern completions in let-stmt

This commit is contained in:
roife 2024-06-23 22:26:01 +08:00
parent 70e9582f4c
commit 9dd4e3ecec
2 changed files with 2 additions and 2 deletions

View file

@ -1334,7 +1334,7 @@ fn pattern_context_for(
.map_or((PatternRefutability::Irrefutable, false), |node| {
let refutability = match_ast! {
match node {
ast::LetStmt(let_) => return (PatternRefutability::Irrefutable, let_.ty().is_some()),
ast::LetStmt(let_) => return (PatternRefutability::Refutable, let_.ty().is_some()),
ast::Param(param) => {
let has_type_ascription = param.ty().is_some();
param_ctx = (|| {

View file

@ -146,7 +146,7 @@ enum SingleVariantEnum {
}
use SingleVariantEnum::Variant;
fn foo() {
let a$0
for a$0
}
"#,
expect![[r#"