-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not discard the result of checking expressions Simplify and canonicalises the AST of waveform assignments Enables completions from within subprograms Remove completions after ';' token
- Loading branch information
1 parent
213a0f8
commit 1027cb2
Showing
11 changed files
with
96 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
// Copyright (c) 2019, Olof Kraigher [email protected] | ||
|
||
use super::*; | ||
use std::vec; | ||
use vhdl_lang::data::error_codes::ErrorCode; | ||
|
||
#[test] | ||
|
@@ -1969,3 +1970,27 @@ end package; | |
let diagnostics = builder.analyze(); | ||
check_no_diagnostics(&diagnostics); | ||
} | ||
|
||
// Issue #317 | ||
#[test] | ||
fn type_mismatch_in_binary_expression() { | ||
let mut builder = LibraryBuilder::new(); | ||
let code = builder.code( | ||
"libname", | ||
"\ | ||
package foo is | ||
function takes_slv(din : bit_vector) return boolean; | ||
constant bar : boolean := takes_slv(true) and true; | ||
end package;", | ||
); | ||
|
||
let diagnostics = builder.analyze(); | ||
check_diagnostics( | ||
diagnostics, | ||
vec![Diagnostic::new( | ||
code.s1("true"), | ||
"'true' does not match array type 'BIT_VECTOR'", | ||
ErrorCode::TypeMismatch, | ||
)], | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters