Ticket #4895: test.mos

File test.mos, 507 bytes (added by Per Östlund, 7 years ago)
Line 
1setCommandLineOptions("-g=MetaModelica, -d=gen");
2loadString("
3package P
4 import MetaModelica.Dangerous.listArrayLiteral;
5
6 uniontype UT1
7 record R1
8 Integer n;
9 end R1;
10 end UT1;
11
12 uniontype UT2
13 record R2
14 array<UT1> ut1;
15 end R2;
16 end UT2;
17
18 constant UT2 ut2 = UT2.R2(
19 listArrayLiteral({})
20 );
21end P;
22
23function f
24 input P.UT2 ut2;
25 output array<P.UT1> ut1 = ut2.ut1;
26end f;
27
28function test
29algorithm
30 f(P.ut2);
31end test;
32");
33getErrorString();
34test();
35getErrorString();