.net parameter name like a type issue

Hi
The compiler gets confused with this code using the current stable. Worked fine in the previous build. I could reproduce this error with this code (the original is different):

namespace ConsoleApplication2;

uses System.Runtime.InteropServices;

const
  OCI_DLL_NAME = 'asd';

type
  Program = class
  public
    [DllImport(OCI_DLL_NAME, CharSet = CharSet.Ansi, SetLastError = True, CallingConvention=CallingConvention.Cdecl)]
    function OCIEnvCreate( charSet: Word): Word; external; static;

    class method Main(args: array of String): Int32;
    begin

    end;
  end;
end.

E: No member "Ansi" on type "Word" [Program.pas (12)]

The problem here is charSet parameter of OCIEnvCreate function. Changing the declaration to
charSet_ : Word
or any other word than charset works, but as I said it compiled with previous stables. Attach a project.
ConsoleApplication2.zip (30.7 KB)

Please check
Regards
Artur

Compiles w/o errors for me, with compiler from yesterday… What could I be missing?


Upp, I sent you fixed version. the declaration should be :slight_smile:
function OCIEnvCreate( charSet: Word): Word; external; static;

reproduced, thanx. sounds like a bug/regression indeed.

Obvious workaround for now; just rename the parameter.

Logged as bugs://E26425.

bugs://E26425 was closed as fixed.