Island issue

Found another Bug:

Have a look:

var list = new TDynamicArray<String>(100);
list.WriteAt(0, 'Hello');
list.WriteAt(1, 'World');
list.Finalize();

TDynamicArray is an own class which is in a namespace of “mDynamicArray” which i include before!
When i compile, i get: “(E0) Internal error: Unknown type ID: f”

Split this off from the long thread… do you have a more complete testcase? Btw you should never call Finalize directly.

Honestly, i dont have another much bigger testcase^^but it happens instantly, when i just declare my dynamicarray-variable, without doing anything spectacular :confused:

And when its forbidden to call Finalize() directly, why is it public then?

can you tell me how TDynamicArray is defined then? Just array of T?

No it is not an array of T, It’s n own valid class implementation, which have a lot of fields, propertys, methods and so on^^

The thing is, i have some multiple blockpointer’s which i Free iteratively, with an own

Free(var block: ^Tblock);
method.

And i dont know, if the embedded GC gets active and finalize’s all blocks i have :confused:

You should use the dispose interface then with using.

1 Like

Next bug, or as i often said, maybe a consious decision:

	TENum = public enum(A, B, C, D);
        TENumArray = array[TEnum] of int32;

Actually this was possible in Delphi/FPC?

PS:

Even: array[0..100] of Object; //doesnt work!

that will make it fairly hard for me to reproduce this issue, without that class.

Not sure what you mean, this works fine:

unit issuemoretest;
interface

type
	TENum = public enum(A, B, C, D);
        TENumArray = array[TEnum] of int32;



implementation

begin  
  var x: TEnumArray;
  x[TEnum.B] := 15;
  var Even: array[0..100] of Object; //doesnt work!    
end.

I can swear, it doesnt work… when i compiled i got: E(0) internal error:

Sry, now it works for as well :sweat_smile: :sweat_smile: :sweat_smile:

If you do get a case where this shows, feel free to zip up the project and sned it to me. I’ll keep it private but it makes sure i’ll be able to reproduce the issue. (you can click my name here and send a private message to reach me privately)

Honestly, i forgot that you answerd for the Dynamicarray issue^^

Yes, i send you my project, but it doesnt work as well not for the TArray (the same aas DynamicArray, in that case, that it is own implemented, but differs ofc in the implementation)

Note that at any time you get an internal error you found a compiler bug, and like hearing about those to get rid of them.

1 Like

I send you my .zip dynamicArray :slight_smile:

Hope you see the bug

1 Like

Unfortunately, i found another bug, when i declare my subrang like this:

TCapacity = 0..100000; 
var rng: TCapacity := High(TCapacity) + 100; 

it still does compile and gives the exact result without any overflow exception or compiler error:!

Island currently does not check integer ranges no. I’ll log a bug but it will have low priority.

Thanks, logged as bugs://77311

Ok, but its relatively annoying to check always the range of the type, like this:

if index < high(TCustomRangeType) then ...

but ok, good that you logged it.

Next Bug:

“E(0) internal error:GOUNKEX 100” ---------------> 0 <= position <= f_length;