Skip to content

Commit 1575146

Browse files
authored
Fix: Consider InterfacePackageInstances in use clauses when selecting all
2 parents 4cc1f7b + 9a96d97 commit 1575146

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

vhdl_lang/src/analysis/design_unit.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,8 @@ impl<'a> AnalyzeContext<'a> {
625625
));
626626
}
627627
Design::Package(_, ref primary_region)
628-
| Design::PackageInstance(ref primary_region) => {
628+
| Design::PackageInstance(ref primary_region)
629+
| Design::InterfacePackageInstance(ref primary_region) => {
629630
scope.make_all_potentially_visible(Some(&name.pos), primary_region);
630631
}
631632
_ => {

vhdl_lang/src/analysis/tests/package_instance.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,3 +608,29 @@ end package;
608608
vec![code.s("sub_t", 1).pos(), code.s("sub_t", 3).pos(),]
609609
);
610610
}
611+
612+
#[test]
613+
pub fn using_all_from_generic_package() {
614+
let mut builder = LibraryBuilder::new();
615+
builder.code(
616+
"libname",
617+
"
618+
package foo is
619+
generic (
620+
x: natural := 1
621+
);
622+
end package;
623+
624+
package bar is
625+
generic (
626+
package foo0 is new work.foo
627+
generic map (<>)
628+
);
629+
use foo0.all;
630+
end package;
631+
",
632+
);
633+
634+
let diag = builder.analyze();
635+
check_no_diagnostics(&diag);
636+
}

0 commit comments

Comments
 (0)