Extension class does not compile when there is a metaclass defined on the same class

Extension class compiles as long as there is no metaclass defined on TFoo.
If there is a metaclass TFooClass defined, E44 appears in extension class.

type
TFooClass = class of TFoo;
TFoo = public class(object)
public
function Bar: String; begin result := ‘Bar’; end;
end;

TFooHelper = public extension class(TFoo)
function TwoBars: String;
begin
result := self.Bar + self.Bar; // -> (E44) No member “Bar” on type “class of TFooHelper”
end;
end;

Oxygene 9.3.103

What platform is this, .NET?

Thanks, logged as bugs://84109

yes, .NET

1 Like

I think this has been long fixed, at least I can’t reproduce it in a .NET project anymore.

bugs://84109 got closed with status cannotrepro.

Fixed? In which version?

Sometime between November 2017 and March 2020 ;).

All I can Gell you it works in the current version; it’s hard to say when exactly it got fixed, since there was no open issue to track this, so int probably got addressed as part of some other change over the past three years,…