Skip to content

Commit 6e7ee1a

Browse files
authored
Fix incorrect "Name must denote a file name" diagnostic
2 parents 6a02808 + 991d6b7 commit 6e7ee1a

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

vhdl_lang/src/analysis/association.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl<'a> AnalyzeContext<'a> {
536536
};
537537
if !matches!(name, ResolvedName::Final(ent) if matches!(
538538
ent.kind(),
539-
AnyEntKind::File(_)
539+
AnyEntKind::File(_) | AnyEntKind::InterfaceFile(_)
540540
)) {
541541
diagnostics.error(actual_pos, "Name must denote a file name");
542542
}

vhdl_lang/src/analysis/tests/assignment_typecheck.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,3 +640,34 @@ end architecture foo;
640640
],
641641
)
642642
}
643+
644+
#[test]
645+
fn legal_file_names() {
646+
let mut builder = LibraryBuilder::new();
647+
builder.code(
648+
"libname",
649+
"\
650+
use std.textio.all;
651+
652+
package foo is
653+
procedure tee(
654+
file file_handle : text;
655+
variable my_line : inout line
656+
);
657+
end package foo;
658+
659+
package body foo is
660+
procedure tee(
661+
file file_handle : text;
662+
variable my_line : inout line
663+
) is
664+
variable v_line : line;
665+
begin
666+
write(v_line, my_line.all);
667+
writeline(file_handle, v_line);
668+
end procedure tee;
669+
end package body;
670+
",
671+
);
672+
check_no_diagnostics(&builder.analyze())
673+
}

0 commit comments

Comments
 (0)