Skip to content

Commit

Permalink
Fix incorrect "Name must denote a file name" diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
Schottkyc137 authored Mar 2, 2024
2 parents 6a02808 + 991d6b7 commit 6e7ee1a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vhdl_lang/src/analysis/association.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ impl<'a> AnalyzeContext<'a> {
};
if !matches!(name, ResolvedName::Final(ent) if matches!(
ent.kind(),
AnyEntKind::File(_)
AnyEntKind::File(_) | AnyEntKind::InterfaceFile(_)
)) {
diagnostics.error(actual_pos, "Name must denote a file name");
}
Expand Down
31 changes: 31 additions & 0 deletions vhdl_lang/src/analysis/tests/assignment_typecheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,34 @@ end architecture foo;
],
)
}

#[test]
fn legal_file_names() {
let mut builder = LibraryBuilder::new();
builder.code(
"libname",
"\
use std.textio.all;
package foo is
procedure tee(
file file_handle : text;
variable my_line : inout line
);
end package foo;
package body foo is
procedure tee(
file file_handle : text;
variable my_line : inout line
) is
variable v_line : line;
begin
write(v_line, my_line.all);
writeline(file_handle, v_line);
end procedure tee;
end package body;
",
);
check_no_diagnostics(&builder.analyze())
}

0 comments on commit 6e7ee1a

Please sign in to comment.