简体   繁体   中英

Delphi2010 Compiler error: F2084 Internal Error: L1737

When I compile our project use Delphi 2010 Trial, there has a fatal error :

[DCC Fatal Error] F2084 Internal Error: L1737

Seem's a internal error. No hint at all.

Is this a compiler bug or trial limit?

Thanks.

I can't give you a definite answer. Have a look at

Internal Compiler Errors

What file does the compiler complain about? Any ideas what COULD be the problem? Any new features used that could still be buggy?

EDIT: and I think we can forget about the trial limit...that would be a very odd way to indicate the end of the trial period.

Things have really improved since Delphi 2009, but there are still a few Generics-related glitches in the compiler that can cause errors like this. Check if you're trying to declare generic classes or methods and then use them under unusual circumstances. If so, try and distill it down to a small, reproducible test case and report it to QC.

Make sure your paths are not mangled with those of older versions.
Make sure you delete all the DCUs used in your project, included 3rd party components (unless you have some component without the source, in that case double check you have the latest DCUs for D2010) then do a build all to regenerate all those.
Then try to cut your application in smaller parts and see what part is causing the problem: the goal is to have the simplest possible application that triggers the error , to be able to send it to Embarcadero with a reasonable chance for them to find the problem...

Finally, I found the problem.

We used one SmartPtr pattern introduced from Barry Kelly's blog, D2010's compiler consider that is invalid. and the smartptr words fine with D2009.

Thanks a lot.

By the way , I post my smartptr here :) and our region still no D2010 for selling :(

I dont know what changed in D2010 compilers's implementation.

type

  TSmartPtr<T: class> = class(TInterfacedObject, TFunc<T>)
  private
    FValue: T;
  public
    constructor Create(AValue: T);
    destructor Destroy; override;
    function Invoke: T;
  end;

  TSmartPtrArray<T: class> = array of TFunc<T>;


implementation

{ TObjectHandle }

constructor TSmartPtr<T>.Create(AValue: T);
begin
  FValue := AValue;
end;

destructor TSmartPtr<T>.Destroy;
begin
  if Assigned(FValue) then
    FValue.Free;
end;

function TSmartPtr<T>.Invoke: T;
begin
  Result := FValue;
end;

I had the same problem because of generics Dictionary type declaration in the procedure (as Atle mentioned). After moving that type declaration to the top of implementation part of unit - L1737 error disappeared.

Same error here. i removed this before:

interface

type
  TBoolFunction = reference to function: Boolean;

I had to move other local "reference to..." constructs from another unit to the interface deceleration to fix it.

No idea as such, but that's definitely a linker error (the code starts with L) and most of these, in turn, are related to function or operator overloading. Those can arise from compiler bugs too, though - for example, in some older Delphi versions (D5 for sure, I think it was fixed in D7) you would get a linker error when using overloaded constructors that took optional parameters.

我认为您使用与旧版delphi版本相同的库路径,因此使用不兼容的DCU。

It means your code is too complex - Any file over a certain threshold in size (10k lines or so) starts to exhibit these problems - the other one is the 'was compiled with a different version of x' errors.

Although it's commonly said to keep related code in the same unit in delphi, it really doesn't scale so ignore that and break down as much as possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM