From: villberg Date: Tue, 26 Aug 2014 12:35:09 +0000 (+0000) Subject: refs #5224 X-Git-Tag: v1.29.0~205 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=dab216d7161273d2cb5e8159fe627c223bf667a0;p=simantics%2Fsysdyn.git refs #5224 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@30142 ac1ea38d-2e2b-0410-8846-a27921b304fc --- 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) {