From dab216d7161273d2cb5e8159fe627c223bf667a0 Mon Sep 17 00:00:00 2001 From: villberg Date: Tue, 26 Aug 2014 12:35:09 +0000 Subject: [PATCH] refs #5224 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30142 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/fi/semantum/sysdyn/solver/Array.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Array.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Array.java index 8747c518..eaa4cca1 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Array.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Array.java @@ -78,7 +78,15 @@ public class Array implements IExpression { } public int size(int col) { - return elements.size(); + + if(col == 1) return elements.size(); + + if(elements.isEmpty()) throw new IllegalStateException(); + Object elem = element(0); + if(!(elem instanceof Array)) throw new IllegalStateException(); + + return ((Array)elem).size(col-1); + } public Object element(int index) { -- 2.47.1