Skip to content

Commit e10c8fe

Browse files
committed
Merge branch 'master' into 179-tool-directives
2 parents 750fc2f + c3409d9 commit e10c8fe

File tree

12 files changed

+255
-74
lines changed

12 files changed

+255
-74
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vhdl_lang/src/analysis/association.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a> AnalyzeContext<'a> {
186186
format!("Ambiguous call to function '{des}'"),
187187
);
188188

189-
diagnostic.add_subprogram_candidates("migth be", candidates);
189+
diagnostic.add_subprogram_candidates("might be", candidates);
190190

191191
return Err(diagnostic.into());
192192
} else if let Some(ent) = candidates.pop() {

vhdl_lang/src/analysis/concurrent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'a> AnalyzeContext<'a> {
9696
}
9797

9898
self.define_labels_for_concurrent_part(
99-
scope,
99+
&nested,
100100
parent,
101101
&mut block.statements,
102102
diagnostics,

vhdl_lang/src/analysis/expression.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ impl Diagnostic {
12511251
Designator::OperatorSymbol(op).describe()
12521252
),
12531253
);
1254-
diag.add_subprogram_candidates("migth be", candidates);
1254+
diag.add_subprogram_candidates("might be", candidates);
12551255
diag
12561256
}
12571257
}
@@ -1453,6 +1453,24 @@ mod test {
14531453
);
14541454
}
14551455

1456+
#[test]
1457+
fn type_attributes_cannot_be_used_as_an_expression() {
1458+
let test = TestSetup::new();
1459+
test.declarative_part("variable x : integer;");
1460+
let code = test.snippet("x'subtype");
1461+
1462+
let mut diagnostics = Vec::new();
1463+
assert_eq!(test.expr_type(&code, &mut diagnostics), None);
1464+
1465+
check_diagnostics(
1466+
diagnostics,
1467+
vec![Diagnostic::error(
1468+
code.s1("x'subtype"),
1469+
"integer type 'INTEGER' cannot be used in an expression",
1470+
)],
1471+
);
1472+
}
1473+
14561474
#[test]
14571475
fn binary_expression_missing_names() {
14581476
let test = TestSetup::new();
@@ -1537,11 +1555,11 @@ function \"-\"(arg : string) return integer;
15371555
Diagnostic::error(code.s1("-"), "ambiguous use of operator \"-\"")
15381556
.related(
15391557
decls.s("\"-\"", 1),
1540-
"migth be operator \"-\"[BIT_VECTOR return INTEGER]",
1558+
"might be operator \"-\"[BIT_VECTOR return INTEGER]",
15411559
)
15421560
.related(
15431561
decls.s("\"-\"", 2),
1544-
"migth be operator \"-\"[STRING return INTEGER]",
1562+
"might be operator \"-\"[STRING return INTEGER]",
15451563
),
15461564
],
15471565
);

0 commit comments

Comments
 (0)