Delphi 来自祖先的嵌套类型的未声明标识符

Delphi 来自祖先的嵌套类型的未声明标识符,delphi,delphi-10.3-rio,Delphi,Delphi 10.3 Rio,我不明白为什么子类TChild看不到祖先嵌套类型TLNested,编译器仍然报告一个找不到它的错误 E2003未声明的标识符:“TLNested” 原始的简化层次结构如下所示 TAncestor = class abstract public type TLNested = class end; strict protected procedure DoSometing(AParam: TLNested); virtual; abstract;

我不明白为什么子类TChild看不到祖先嵌套类型TLNested,编译器仍然报告一个找不到它的错误

E2003未声明的标识符:“TLNested”

原始的简化层次结构如下所示

  TAncestor = class abstract
  public
    type
      TLNested = class
      end;
  strict protected
    procedure DoSometing(AParam: TLNested); virtual; abstract;
  end;

  TChild = class(TAncestor)
  strict protected
    procedure DoSometing(AParam: TLNested); override;
  end;
不幸的是,即使我进一步简化它,它仍然不起作用。有人知道我错过了什么吗

  TAncestor = class
  public
    type
      TLNested = class
      end;
  end;

  TChild = class(TAncestor)
  public
    procedure DoSometing(AParam: TLNested);
  end;

您需要使用完全限定名

  TChild = class(TAncestor)
  public
    procedure DoSometing(AParam: TAncestor.TLNested);
  end;

您需要使用完全限定名

  TChild = class(TAncestor)
  public
    procedure DoSometing(AParam: TAncestor.TLNested);
  end;