Skip to content

Commit

Permalink
- Added initial support for MetaModelica array<ty>, including initial…
Browse files Browse the repository at this point in the history
… versions of arrayCreate, arrayGet and arrayLength (based on a list implementation which needs to be replaced).

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4632 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Dec 4, 2009
1 parent c95b664 commit 5f7b4cc
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 348 deletions.
40 changes: 11 additions & 29 deletions Compiler/Builtin.mo
Expand Up @@ -2687,22 +2687,14 @@ protected constant tuple<DAE.TType, Option<Type_a>> array1dBoolInt2bool =(
protected constant tuple<DAE.TType, Option<Type_a>> array1dStringInt2string =(
DAE.T_FUNCTION({("x1",(DAE.T_ARRAY(DAE.DIM(SOME(1)), (DAE.T_STRING({}),NONE)),NONE)),("x2",(DAE.T_INTEGER({}),NONE))},(DAE.T_STRING({}),NONE)),NONE);

// arrayCreate
protected constant tuple<DAE.TType, Option<Type_a>> intAny2array1dAny =(
DAE.T_FUNCTION({("x1",(DAE.T_INTEGER({}),NONE)),("x2",(DAE.T_NOTYPE(),NONE))},(DAE.T_ARRAY(DAE.DIM(SOME(1)), (DAE.T_NOTYPE(),NONE)),NONE)),NONE);

protected constant tuple<DAE.TType, Option<Type_a>> intInt2array1dInt =(
DAE.T_FUNCTION({("x1",(DAE.T_INTEGER({}),NONE)),("x2",(DAE.T_INTEGER({}),NONE))},(DAE.T_ARRAY(DAE.DIM(SOME(1)), (DAE.T_INTEGER({}),NONE)),NONE)),NONE);

protected constant tuple<DAE.TType, Option<Type_a>> intReal2array1dReal =(
DAE.T_FUNCTION({("x1",(DAE.T_INTEGER({}),NONE)),("x2",(DAE.T_REAL({}),NONE))},(DAE.T_ARRAY(DAE.DIM(SOME(1)), (DAE.T_REAL({}),NONE)),NONE)),NONE);

protected constant tuple<DAE.TType, Option<Type_a>> intBool2array1dBool =(
DAE.T_FUNCTION({("x1",(DAE.T_INTEGER({}),NONE)),("x2",(DAE.T_BOOL({}),NONE))},(DAE.T_ARRAY(DAE.DIM(SOME(1)), (DAE.T_BOOL({}),NONE)),NONE)),NONE);

protected constant tuple<DAE.TType, Option<Type_a>> intString2array1dString =(
DAE.T_FUNCTION({("x1",(DAE.T_INTEGER({}),NONE)),("x2",(DAE.T_STRING({}),NONE))},(DAE.T_ARRAY(DAE.DIM(SOME(1)), (DAE.T_STRING({}),NONE)),NONE)),NONE);

// MetaModelica builtin array functions
protected constant tuple<DAE.TType, Option<Type_a>> intA2marrayA =(
DAE.T_FUNCTION({("x1",(DAE.T_INTEGER({}),NONE)),("x2",(DAE.T_POLYMORPHIC("A"),NONE))},(DAE.T_META_ARRAY((DAE.T_POLYMORPHIC("A"),NONE)),NONE)),NONE);
protected constant tuple<DAE.TType, Option<Type_a>> marrayAny2int =(
DAE.T_FUNCTION({("x1",(DAE.T_ANYTYPE(NONE),NONE))},(DAE.T_INTEGER({}),NONE)),NONE);
protected constant tuple<DAE.TType, Option<Type_a>> marrayAInt2A =(
DAE.T_FUNCTION({("x1",(DAE.T_META_ARRAY((DAE.T_POLYMORPHIC("A"),NONE)),NONE)),("x2",(DAE.T_INTEGER({}),NONE))},(DAE.T_POLYMORPHIC("A"),NONE)),NONE);

// String functions. sjoelund
protected constant tuple<DAE.TType, Option<Type_a>> string2string=(
DAE.T_FUNCTION({("x",(DAE.T_STRING({}),NONE))},(DAE.T_STRING({}),NONE)),NONE);
Expand Down Expand Up @@ -3571,19 +3563,9 @@ algorithm
env = Env.extendFrameT(env, "listEmpty", list2boolean);

// Array Operations
env = Env.extendFrameT(env, "arrayLength", array1d2int);

env = Env.extendFrameT(env, "arrayGet", array1dAnyInt2any);
env = Env.extendFrameT(env, "arrayIntegerGet", array1dIntInt2int);
env = Env.extendFrameT(env, "arrayRealGet", array1dRealInt2real);
env = Env.extendFrameT(env, "arrayBooleanGet", array1dBoolInt2bool);
env = Env.extendFrameT(env, "arrayStringGet", array1dStringInt2string);

env = Env.extendFrameT(env, "arrayCreate", intAny2array1dAny);
env = Env.extendFrameT(env, "arrayIntegerCreate", intInt2array1dInt);
env = Env.extendFrameT(env, "arrayRealCreate", intReal2array1dReal);
env = Env.extendFrameT(env, "arrayBooleanCreate", intBool2array1dBool);
env = Env.extendFrameT(env, "arrayStringCreate", intString2array1dString);
env = Env.extendFrameT(env, "arrayLength", marrayAny2int);
env = Env.extendFrameT(env, "arrayGet", marrayAInt2A);
env = Env.extendFrameT(env, "arrayCreate", intA2marrayA);

// Option Operations
env = Env.extendFrameT(env, "optionNone", option2boolean);
Expand Down
6 changes: 6 additions & 0 deletions Compiler/ClassInf.mo
Expand Up @@ -142,6 +142,10 @@ uniontype State "- Machine states, the string contains the classname."
String string;
end UNIONTYPE;

record META_ARRAY
String string;
end META_ARRAY;

record META_POLYMORPHIC
String string;
end META_POLYMORPHIC;
Expand Down Expand Up @@ -194,6 +198,7 @@ algorithm
case META_OPTION(s) then "Option";
case META_RECORD(s) then "meta_record";
case META_POLYMORPHIC(s) then "polymorphic";
case META_ARRAY(s) then "meta_array";
case UNIONTYPE(s) then "uniontype";
case _ then "#printStateStr failed#";
end matchcontinue;
Expand Down Expand Up @@ -323,6 +328,7 @@ algorithm
case META_OPTION(s) then s;
case META_RECORD(s) then s;
case META_POLYMORPHIC(s) then s;
case META_ARRAY(s) then s;
case UNIONTYPE(s) then s;
case _ then "#getStateName failed#";
end matchcontinue;
Expand Down
37 changes: 14 additions & 23 deletions Compiler/Codegen.mo
Expand Up @@ -1843,6 +1843,7 @@ algorithm
case (DAE.ET_METAOPTION(_)) then "metatype";
case (DAE.ET_UNIONTYPE()) then "metatype";
case (DAE.ET_POLYMORPHIC()) then "metatype";
case (DAE.ET_META_ARRAY(_)) then "metatype";
case (DAE.ET_BOXED(_)) then "metatype";

case t
Expand Down Expand Up @@ -1942,11 +1943,10 @@ algorithm
str;

// MetaModelica Types
case ((DAE.T_LIST(_),_)) then "void*";
case ((DAE.T_METATUPLE(_),_)) then "void*";
case ((DAE.T_METAOPTION(_),_)) then "void*";
case ((DAE.T_UNIONTYPE(_),_)) then "void*";
case ((DAE.T_POLYMORPHIC(_),_)) then "void*";
case ty
equation
true = Types.isBoxedType(ty);
then "void*";

case ((DAE.T_ARRAY(arrayDim = dim,arrayType = ty),_))
equation
Expand Down Expand Up @@ -2045,13 +2045,12 @@ algorithm
case ((DAE.T_COMPLEX(complexClassType = ClassInf.EXTERNAL_OBJ(_)),_)) then "modelica_complex";
case ((DAE.T_COMPLEX(ClassInf.TYPE(_),{},SOME(ty),_),_)) then generateSimpleType(ty);

case ((DAE.T_LIST(_),_)) then "modelica_metatype"; // MetaModelica list
case ((DAE.T_METATUPLE(_),_)) then "modelica_metatype"; // MetaModelica tuple
case ((DAE.T_METAOPTION(_),_)) then "modelica_metatype"; // MetaModelica tuple
case ((DAE.T_FUNCTION(_,_),_)) then "modelica_fnptr";
case ((DAE.T_UNIONTYPE(_),_)) then "modelica_metatype";
case ((DAE.T_POLYMORPHIC(_),_)) then "modelica_metatype";
case ((DAE.T_BOXED(ty),_)) then "modelica_metatype";
// Any MetaModelica type
case ty
equation
true = Types.isBoxedType(ty);
then "modelica_metatype";

case ((t as (DAE.T_ARRAY(arrayDim = _),_)))
equation
Expand All @@ -2060,14 +2059,6 @@ algorithm
then
t_str;

case ((DAE.T_LIST(_),_)) then "modelica_metatype"; // MetaModelica list
case ((DAE.T_METATUPLE(_),_)) then "modelica_metatype"; // MetaModelica tuple
case ((DAE.T_METAOPTION(_),_)) then "modelica_metatype"; // MetaModelica option
case ((DAE.T_UNIONTYPE(_),_)) then "modelica_metatype"; //MetaModelica uniontypes, added by simbj
case ((DAE.T_POLYMORPHIC(_),_)) then "modelica_metatype"; //MetaModelica polymorphic type
case ((DAE.T_BOXED(_),_)) then "modelica_metatype"; //MetaModelica boxed type
case ((DAE.T_FUNCTION(_,_),_)) then "modelica_fnptr";

case (ty)
equation
t_str = Types.unparseType(ty);
Expand Down Expand Up @@ -8774,10 +8765,10 @@ algorithm
ret;
case ((DAE.T_TUPLE(_), _)) then "TYPE_DESC_TUPLE";
case ((DAE.T_COMPLEX(complexClassType = ClassInf.RECORD(_)), _)) then "TYPE_DESC_RECORD";
case ((DAE.T_UNIONTYPE(_), _)) then "TYPE_DESC_MMC";
case ((DAE.T_METATUPLE(_), _)) then "TYPE_DESC_MMC";
case ((DAE.T_POLYMORPHIC(_), _)) then "TYPE_DESC_MMC";
case ((DAE.T_LIST(_), _)) then "TYPE_DESC_MMC";
case t
equation
true = Types.isBoxedType(t);
then "TYPE_DESC_MMC";
case (_) then "TYPE_DESC_COMPLEX";
end matchcontinue;
end generateRWType;
Expand Down
8 changes: 8 additions & 0 deletions Compiler/DAE.mo
Expand Up @@ -613,6 +613,10 @@ uniontype TType "-TType contains the actual type"
String name;
end T_POLYMORPHIC;

record T_META_ARRAY
Type ty;
end T_META_ARRAY;

end TType;

public
Expand Down Expand Up @@ -797,6 +801,10 @@ uniontype ExpType "- Basic types

record ET_POLYMORPHIC "Used in MetaModelica polymorphic functions" end ET_POLYMORPHIC;

record ET_META_ARRAY "Array with MetaModelica semantics"
ExpType ty;
end ET_META_ARRAY;

record ET_NORETCALL "For functions not returning any values." end ET_NORETCALL;

end ExpType;
Expand Down
123 changes: 40 additions & 83 deletions Compiler/Inst.mo
Expand Up @@ -2414,7 +2414,7 @@ algorithm
true = RTOpts.acceptMetaModelicaGrammar();
(cache,cenv,ih,tys,csets,oDA) =
instClassDefHelper(cache,env,ih,tSpecs,pre,inst_dims,impl,{},csets);
ty = Util.listFirst(tys);
{ty} = tys;
bc = SOME((DAE.T_METAOPTION(ty),NONE));
oDA = Absyn.mergeElementAttributes(DA,oDA);
then (cache,env,ih,store,{},csets,ClassInf.META_OPTION(""),{},bc,oDA,NONE,graph);
Expand All @@ -2432,6 +2432,20 @@ algorithm
oDA = Absyn.mergeElementAttributes(DA,oDA);
then (cache,env,ih,store,{},csets,ClassInf.META_TUPLE(""),{},bc,oDA,NONE,graph);

case (cache,env,ih,store,mods,pre,csets,ci_state,className,
SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT("array"),tSpecs,_),modifications = mod, attributes=DA),
re,prot,inst_dims,impl,graph,instSingleCref)
local
list<Absyn.TypeSpec> tSpecs; list<DAE.Type> tys; DAE.Type ty;
Absyn.ElementAttributes DA;
equation
true = RTOpts.acceptMetaModelicaGrammar();
(cache,cenv,ih,tys,csets,oDA) = instClassDefHelper(cache,env,ih,tSpecs,pre,inst_dims,impl,{},csets);
{ty} = tys;
bc = SOME((DAE.T_META_ARRAY(ty),NONE));
oDA = Absyn.mergeElementAttributes(DA,oDA);
then (cache,env,ih,store,{},csets,ClassInf.META_ARRAY(className),{},bc,oDA,NONE,graph);

case (cache,env,ih,store,mods,pre,csets,ci_state,className,
SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT("polymorphic"),{Absyn.TPATH(Absyn.IDENT("Any"),NONE)},_),modifications = mod, attributes=DA),
re,prot,inst_dims,impl,graph,instSingleCref)
Expand Down Expand Up @@ -3941,6 +3955,7 @@ algorithm
(cdefelts,extendsclasselts,_,_) = splitElts(els);
extendsclasselts = listAppend(inClassExtendsList,extendsclasselts);
(cenv3,ih) = addClassdefsToEnv(cenv3,ih, cdefelts, impl, NONE);

(cache,_,ih,mods,compelts1,eq2,ieq2,alg2,ialg2) = instExtendsList(cache,cenv3,ih,outermod, els_1, ci_state, className, extendsclasselts, impl)
"recurse to fully flatten extends elements env" ;
(cache,env2,ih,mods_1,compelts2,eq3,ieq3,alg3,ialg3) = instExtendsList(cache,env,ih, mod, rest, ci_state, className, extendsclasselts, impl)
Expand Down Expand Up @@ -6422,7 +6437,7 @@ algorithm
// anyhow the modifications are handled below.
// input Integer sequence[3](min = {1,1,1}, max = {3,3,3}) = {1,2,3}; // this will fail if we send in the mod.
// see testsuite/mofiles/Sequence.mo
(cache,env_1,ih,store,_,csets_1,ty,st,_,graph) = instClass(cache,env,ih,store, /* mod */ DAE.NOMOD(), pre, csets, cl, inst_dims, impl, INNER_CALL(), graph);
(cache,env_1,ih,store,_,csets_1,ty,st,_,graph) = instClass(cache,env,ih,store, /* mod */ DAE.NOMOD(), pre, csets, cl, inst_dims, impl, INNER_CALL(), graph);
//Make it an array type since we are not flattening
ty_1 = makeArrayType(dims, ty);

Expand Down Expand Up @@ -6745,19 +6760,7 @@ algorithm
/*------------------------*/
/* MetaModelica extension */
case (cache,env,_,_,cl as SCode.CLASS(name = id,
classDef = SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT("list"),_,arrayDim = ad),
modifications = mod)),
dims,impl)
equation
true=RTOpts.acceptMetaModelicaGrammar();
owncref = Absyn.CREF_IDENT(id,{});
ad_1 = getOptionArraydim(ad);
// Absyn.IDENT("Integer") used as a dummie
(cache,dim1) = elabArraydim(cache,env, owncref, Absyn.IDENT("Integer"), ad_1, NONE, impl, NONE,true);
then (cache,dim1,cl);

case (cache,env,_,_,cl as SCode.CLASS(name = id,
classDef = SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT("tuple"),_,arrayDim = ad),
classDef = SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT(_),_,arrayDim = ad),
modifications = mod)),
dims,impl)
equation
Expand All @@ -6767,31 +6770,6 @@ algorithm
// Absyn.IDENT("Integer") used as a dummie
(cache,dim1) = elabArraydim(cache,env, owncref, Absyn.IDENT("Integer"), ad_1, NONE, impl, NONE,true);
then (cache,dim1,cl);

case (cache,env,_,_,cl as SCode.CLASS(name = id,
classDef = SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT("Option"),_,arrayDim = ad),
modifications = mod)),
dims,impl)
equation
true =RTOpts.acceptMetaModelicaGrammar();
owncref = Absyn.CREF_IDENT(id,{});
ad_1 = getOptionArraydim(ad);
// Absyn.IDENT("Integer") used as a dummie
(cache,dim1) = elabArraydim(cache,env, owncref, Absyn.IDENT("Integer"), ad_1, NONE, impl, NONE,true);
then (cache,dim1,cl);

case (cache,env,_,_,cl as SCode.CLASS(name = id,
classDef = SCode.DERIVED(Absyn.TCOMPLEX(Absyn.IDENT("polymorphic"),_,arrayDim = ad),
modifications = mod)),
dims,impl)
equation
true=RTOpts.acceptMetaModelicaGrammar();
owncref = Absyn.CREF_IDENT(id,{});
ad_1 = getOptionArraydim(ad);
// Absyn.IDENT("Integer") used as a dummie
(cache,dim1) = elabArraydim(cache,env, owncref, Absyn.IDENT("Integer"), ad_1, NONE, impl, NONE,true);
then (cache,dim1,cl);

// Partial function definitions with no output - stefan
case (cache,env,_,_,cl as SCode.CLASS(name = id,restriction = SCode.R_FUNCTION(),partialPrefix = true),_,_) then (cache,{},cl);
case (cache,env,_,_,SCode.CLASS(name = id,restriction = SCode.R_FUNCTION(),partialPrefix = false),_,_)
Expand Down Expand Up @@ -8397,6 +8375,7 @@ algorithm
case (cache,_,path as Absyn.IDENT("Option")) equation true=RTOpts.acceptMetaModelicaGrammar(); then (cache,path);
case (cache,_,path as Absyn.IDENT("tuple")) equation true=RTOpts.acceptMetaModelicaGrammar(); then (cache,path);
case (cache,_,path as Absyn.IDENT("polymorphic")) equation true=RTOpts.acceptMetaModelicaGrammar(); then (cache,path);
case (cache,_,path as Absyn.IDENT("array")) equation true=RTOpts.acceptMetaModelicaGrammar(); then (cache,path);
/*-------------------------*/

/* To make a class fully qualified, the class path is looked up in the environment.
Expand Down Expand Up @@ -9496,49 +9475,6 @@ algorithm
case (vn,ty as(DAE.T_ENUMERATION(SOME(_),_,_,_),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars) then {};
// case (vn,ty as(DAE.T_ENUM(),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars) then {};

/* MetaModelica extensions */
case (vn,ty as(DAE.T_LIST(_),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars)
equation
true = RTOpts.acceptMetaModelicaGrammar();
finst_dims = Util.listFlatten(inst_dims);
dae_var_attr = DAEUtil.setFinalAttr(dae_var_attr,finalPrefix);
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};
case (vn,ty as(DAE.T_METATUPLE(_),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars)
equation
true = RTOpts.acceptMetaModelicaGrammar();
finst_dims = Util.listFlatten(inst_dims);
dae_var_attr = DAEUtil.setFinalAttr(dae_var_attr,finalPrefix);
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};
case (vn,ty as(DAE.T_METAOPTION(_),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars)
equation
true = RTOpts.acceptMetaModelicaGrammar();
finst_dims = Util.listFlatten(inst_dims);
dae_var_attr = DAEUtil.setFinalAttr(dae_var_attr,finalPrefix);
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};
case (vn,ty as(DAE.T_UNIONTYPE(_),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars)
equation
true = RTOpts.acceptMetaModelicaGrammar();
finst_dims = Util.listFlatten(inst_dims);
dae_var_attr = DAEUtil.setFinalAttr(dae_var_attr,finalPrefix);
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};
case (vn,ty as(DAE.T_POLYMORPHIC(_),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars)
equation
true = RTOpts.acceptMetaModelicaGrammar();
finst_dims = Util.listFlatten(inst_dims);
dae_var_attr = DAEUtil.setFinalAttr(dae_var_attr,finalPrefix);
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};
case (vn,(tty as DAE.T_FUNCTION(_,_),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars)
local
DAE.TType tty;
Absyn.Path path;
equation
finst_dims = Util.listFlatten(inst_dims);
dae_var_attr = DAEUtil.setFinalAttr(dae_var_attr,finalPrefix);
path = Exp.crefToPath(vn);
ty = (tty,SOME(path));
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};
/*----------------------------*/

/* We should not declare each enumeration value of an enumeration when instantiating,
* e.g Myenum my !=> constant EnumType my.enum1,... {DAE.VAR(vn, kind, dir, DAE.ENUM, e, inst_dims)}
* instantiation of complex type extending from basic type
Expand Down Expand Up @@ -9585,6 +9521,26 @@ algorithm
finst_dims = Util.listFlatten(inst_dims);
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};

/* MetaModelica extensions */
case (vn,(tty as DAE.T_FUNCTION(_,_),_),fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars)
local
DAE.TType tty;
Absyn.Path path;
equation
finst_dims = Util.listFlatten(inst_dims);
dae_var_attr = DAEUtil.setFinalAttr(dae_var_attr,finalPrefix);
path = Exp.crefToPath(vn);
ty = (tty,SOME(path));
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};
case (vn,ty,fl,st,kind,dir,prot,e,inst_dims,start,dae_var_attr,comment,io,finalPrefix,declareComplexVars)
equation
true = RTOpts.acceptMetaModelicaGrammar();
true = Types.isBoxedType(ty);
finst_dims = Util.listFlatten(inst_dims);
dae_var_attr = DAEUtil.setFinalAttr(dae_var_attr,finalPrefix);
then {DAE.VAR(vn,kind,dir,prot,ty,e,finst_dims,fl,st,{},dae_var_attr,comment,io)};
/*----------------------------*/

case (c,ty,_,_,_,_,_,_,_,_,_,_,_,_,_) then {};
end matchcontinue;
end daeDeclare4;
Expand Down Expand Up @@ -12483,6 +12439,7 @@ algorithm
case (p,ClassInf.META_OPTION(_),_,SOME(bc2),_) local DAE.Type bc2; equation then bc2;
case (p,ClassInf.META_LIST(_),_,SOME(bc2),_) local DAE.Type bc2; equation then bc2;
case (p,ClassInf.META_POLYMORPHIC(_),_,SOME(bc2),_) local DAE.Type bc2; equation then bc2;
case (p,ClassInf.META_ARRAY(_),_,SOME(bc2),_) local DAE.Type bc2; equation then bc2;
/*------------------------*/

case (p,st,l,bc,equalityConstraint)
Expand Down
10 changes: 10 additions & 0 deletions Compiler/MetaUtil.mo
Expand Up @@ -1381,6 +1381,16 @@ algorithm
String id;
then Absyn.TPATH(Absyn.IDENT(id),NONE);

case ((DAE.T_META_ARRAY(t),_))
local
Absyn.TypeSpec tSpec;
DAE.Type t;
list<Absyn.TypeSpec> tSpecList;
equation
tSpec = typeConvert(t);
tSpecList = {tSpec};
then Absyn.TCOMPLEX(Absyn.IDENT("array"),tSpecList,NONE());

case ((_,SOME(p)))
local
Absyn.Path p;
Expand Down

0 comments on commit 5f7b4cc

Please sign in to comment.