Skip to content

Commit c715b9f

Browse files
committed
Fix missing evaluation in case generate statement choice and expression
1 parent 6bc3a21 commit c715b9f

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

vhdl_lang/src/analysis/concurrent.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,24 @@ impl<'a> AnalyzeContext<'a> {
157157
}
158158
}
159159
ConcurrentStatement::CaseGenerate(ref mut gen) => {
160-
for alternative in gen.sels.alternatives.iter_mut() {
160+
let CaseGenerateStatement {
161+
sels:
162+
Selection {
163+
ref mut expression,
164+
ref mut alternatives,
165+
},
166+
end_label_pos: _,
167+
} = gen;
168+
169+
let ctyp = as_fatal(self.expr_unambiguous_type(scope, expression, diagnostics))?;
170+
for alternative in alternatives.iter_mut() {
171+
let Alternative {
172+
ref mut choices,
173+
ref mut item,
174+
} = alternative;
175+
self.choice_with_ttyp(scope, ctyp, choices, diagnostics)?;
161176
let nested = scope.nested();
162-
self.analyze_generate_body(
163-
&nested,
164-
parent,
165-
&mut alternative.item,
166-
diagnostics,
167-
)?;
177+
self.analyze_generate_body(&nested, parent, item, diagnostics)?;
168178
}
169179
}
170180
ConcurrentStatement::Instance(ref mut instance) => {

0 commit comments

Comments
 (0)