내가 제네릭 많이 사용 및 인터페이스 유형을 만드는, 최대 고정하고, 나는 오류델파이 컴파일러 오류 E2134의 의미는 무엇입니까? 일부 코드에서
E2134, Type '<void>' has no type info.
얻고 나는 내가 리팩토링의 중간에이기 때문에 그것을 믿는 곳의 일부 중첩 세트 모든 제네릭을 사용하는 장치는 동기화되지 않지만 오류가 나타나는 위치에서 코드에 문제가 없기 때문에 오류 메시지를 사용하여 코드를 수정할 수있는 곳에서 오류가 발생하지 않습니다 .
IThingContainer = interface ...
...
procedure DoSomething(const Param);
end;
:
unit GenericThing;
...
interface
...
type
...
IThingListOf<ThingT> = interface(IThingContainer)
function getEnumerator: TEnumerator<ThingT>;
function getCount: Integer;
function getThing(Index: integer): ThingT;
function getFirst: ThingT;
function IndexOf(value: ThingT): integer;
function addItem(const Thing: ThingT): ThingT;
function removeItem(const Thing: ThingT): Integer;
procedure clear;
procedure Sort; overload;
procedure Sort(const AComparer: IComparer<ThingT>); overload;
property Count: integer read getCount;
property First: ThingT read getFirst;
property Items[Index: integer]: ThingT read getThing; default;
end;
// error appears on whatever line number comes after the declaration of IThingListOf<ThingT>...end;
function AnythingYouLikeHere:Integer; // there is nothign wrong with this line, but you get the E2134 here.
문제가 IThingContainer 자체에 있음을 나타납니다 여기에
내가 코드를 게시 할 수 없기 때문에,이 너무 많이, 조롱 맥락이다 위의 "const Param"에는 유형 정보가 없습니다. 이것은 파스칼/델파이의 이상한 (겨드랑이) 제 견해로, 당신이 완전히 강한 타이핑에 대한 와튼의 생각을 위반하는 것입니다. 이것은 C의 "void *"포인터 나 델파이의 "Pointer"타입처럼 약한 형태이지만, Move와 같은 표준 pre-object-pascal RTL 함수를 제외하고는 거의 사용되지 않습니다. 에. 제네릭에서 사용되는 인터페이스의 유형이 지정되지 않은 매개 변수는 허용되거나 허용되지 않지만 때때로 허용되지 않으며 다른 경우 허용되지 않아야합니다.이
특히 사용할 수 IThingContainer의 정의없이 2009 년
BRILLIANT. 고맙습니다. –