Opened 13 years ago

Last modified 13 years ago

#1591 closed defect (fixed)

MetaModelica: Faster singleton uniontype matching

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone:
Component: Version:
Keywords: Cc: Martin Sjölund,

Description

package P
  uniontype UT
    record R Real r; end R;
  end UT;
  function f
    input UT u;
    output Real o;
  algorithm
    o := match u
      case R(o) then o;
    end match;
  end f;
  constant Real r = f(R(1.5));
end P;

The generated code will verify that u has the correct type before using it, but that's not necessary.

Change History (1)

comment:1 by Martin Sjölund, 13 years ago

This is quite annoying to implement as dynload/runtime does not contain enough information (type of a value is needed by the compiler; i will try to remove this silly notion)

Note: See TracTickets for help on using tickets.