(E382) Type "Tx" cannot be used as a type for public member x of type "__Global", because it is not public

Hi
New stable release .2743 reports .net compiler errors in a project with the Delphi Compatibility option enabled. Here is a test case :

namespace Test ;

interface

implementation

type
  T_Logger  = class
  end ;
var
  loggerObj : T_Logger ;
end.

This code worked for a long long time and works also in Java.
The proposed fix raises another error :
class defined in the implementation section cannot have an access modifier

Can you verify this issue?
Regards
Artur

I believe this is as designed? public types must be in the interface section…

For the “fix” it’s true but this is not my problem. I still want to hide type and var in implementation.

I’m not sure I understand. what’s your goal here? to have a public field, the type must be public.

Here is a .net test project that works (and always worked) on older releases, and works in Java in the latest release:


ConsoleApplication3.zip (62.5 KB)
New stable release .2743 fails to compile this project for .net.

Hmm, that’s curious, to say the least. I’ll have to confer with the compiler team

Logged as bugs://E25923.

bugs://E25923 was closed as fixed.