Skip to content

Commit

Permalink
Return -1 when the inference via connections fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
hokeun authored and cmnrd committed Jul 12, 2022
1 parent 5a10005 commit b624dc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion org.lflang/src/org/lflang/ASTUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,12 @@ public static int width(WidthSpec spec, List<Instantiation> instantiations) {
// If the width cannot be determined because term's width <= 0, which means the term's width
// must be inferred, try to infer the width using connections.
if (spec.eContainer() instanceof Instantiation) {
return inferWidthFromConnections(spec, instantiations);
try {
return inferWidthFromConnections(spec, instantiations);
} catch (InvalidSourceException e) {
// If the inference fails, return -1.
return -1;
}
}
}
}
Expand Down

0 comments on commit b624dc8

Please # to comment.