Forward declaration, partial and inheritance

Issue #88 resolved
Dany Marmur created an issue

At commit 8089060 the following script compiles:

unit test;

interface

type
  JClassOne = partial class external 'ClassOne';

  JClassTwo = partial class external 'ClassTwo' (JClassOne)
  public
  end;

  JClassOne = class external 'ClassOne'
  public
  end;

After commit 03b7919 or newer the script gives errors:

Syntax Error: Class "JClassOne" isn't defined completely [line: 8, column: 50]
Syntax Error: External classes must inherit from an external class or Object [line: 8, column: 59]

Comments (5)

  1. Christian Budde

    I found the same issue. However, in my case I was able to find solutions which were better in terms clearness.

    In your case I would bet that adding an additional 'partial' modifier to the second class declaration might solve it.

    Or additionally if you add an 'end;' after the first declaration might solve the issue.

    As of now the first partial declaration is just some sort of forward, which doesn't find an equivalent. Adding the additional 'end;' will convert it right at the beginning to a partial class (and not a forward).

  2. Log in to comment