Skip to content

Commit 67f001e

Browse files
committed
test: add test case for Self
1 parent 8a0a3b2 commit 67f001e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs

+21
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,27 @@ mod tests {
451451

452452
use super::*;
453453

454+
#[test]
455+
fn issue_16197() {
456+
check_assist(
457+
extract_struct_from_enum_variant,
458+
r#"
459+
enum Foo {
460+
Bar $0{ node: Box<Self> },
461+
Nil,
462+
}
463+
"#,
464+
r#"
465+
struct Bar{ node: Box<Foo> }
466+
467+
enum Foo {
468+
Bar(Bar),
469+
Nil,
470+
}
471+
"#,
472+
);
473+
}
474+
454475
#[test]
455476
fn test_extract_struct_several_fields_tuple() {
456477
check_assist(

0 commit comments

Comments
 (0)