문제

This question came up when trying to assign the OnUDPRead event on an Indy IdUDPServer component. (DelphiXE Update 1)

The following auto-generated code gives a syntax error "Expected '>' but '.' found":

procedure TForm1.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
  AData: TArray<System.Byte>; ABinding: TIdSocketHandle);

I can work around this by changing the declaration to:

procedure TForm1.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
  AData: TArray<Byte>; ABinding: TIdSocketHandle);

For future reference, how do I fully qualify a type identifier in a generic method?

도움이 되었습니까?

해결책

Fully qualified type identifiers are not (yet) supported. But you can circumvent this using a type alias:

type
  TMyByte = System.Byte;

procedure TForm1.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
  AData: TArray<TMyByte>; ABinding: TIdSocketHandle);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top