Compile error

IDE: Fire_
Version: 9.2 / 9.3
Target OSX
Description:
this code create a compile error:
Entering phase “Generating Output, Phase 2” (00:00:00.0518467)
: error E0: Internal error: Invalid cast

namespace testcompile;

interface
uses CoreGraphics;
type
  TCadPenstyle = public enum (cpsSolid, cpsDot, cpsDashDotDot);
  tvcolprms = array [0 .. 3] of Single;

  cadCanvas = class
  private

    context : CGContextRef;
  public
    method setLineStyle(col: Integer; width: Integer; style: TCadPenstyle);
  end;

implementation
method cadCanvas.setLineStyle(col: Integer; width: Integer; style: TCadPenstyle);
var lcol : tvcolprms;
//dash  : array[0..] of  CGFloat;
begin
  //getRealColor(col, var lcol);
  CGContextSetRGBStrokeColor(context, lcol[0], lcol[1],lcol[2],lcol[3]);
  CGContextSetLineWidth(context, width * 1.0);


  case style of
    TCadPenstyle.cpsSolid : CGContextSetLineDash(context, 0.0, nil, 0);

    TCadPenstyle.cpsDot : begin
      var dash : array [0..1] of CGFloat;
      dash   := [4.0, 4.0];
      CGContextSetLineDash(context, 0.0, @dash[0], 2);
    end;

    TCadPenstyle.cpsDashDotDot : begin
       var dash : array [0..2] of CGFloat;
      dash  := [4.0, 4.0, 2.0];
      CGContextSetLineDash(context, 2.0, @dash[0], 3);
    end;

  end;

end;
end.

Thanks, logged as bugs://78573

bugs://78573 got closed with status fixed.

Wow that was a fast fix :wink:

2 Likes