Ticket #4895: test.mos
File test.mos, 507 bytes (added by perost, 6 years ago) |
---|
Line | |
---|---|
1 | setCommandLineOptions("-g=MetaModelica, -d=gen"); |
2 | loadString(" |
3 | package 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 | ); |
21 | end P; |
22 | |
23 | function f |
24 | input P.UT2 ut2; |
25 | output array<P.UT1> ut1 = ut2.ut1; |
26 | end f; |
27 | |
28 | function test |
29 | algorithm |
30 | f(P.ut2); |
31 | end test; |
32 | "); |
33 | getErrorString(); |
34 | test(); |
35 | getErrorString(); |