Java and Cannot access an assembly visible member from another namespace error

Hi

The new stable release introduced new error in my Java projects :

Cannot access an assembly visible member from another namespace

I have a variable declared in one file and namespace in the project :

namespace consoleapp111;

interface

var
  DecimalSeparator  :  String ; //public ;

implementation

end.

and another file in another namespace :

namespace consoleapplication2;

uses
  remobjects.elements.rtl.*,
  consoleapp111,
  java.util;

type
  Program = class
  public

    class method Main(args: array of String): Int32;
    begin
      var oldsep := DecimalSeparator   ;      // <- ERROR
    end;
  end;

end.

Sample project here : consoleapplication2.zip (4.5 KB)

This code works in .NET and worked in previous stable and preview releases for Java (from last week). To make it work I have to add public to the variable declaration. Is this correct and requires a fix now in my code or a bug?

Actually this should have changed everywhere, not just Java, but it’s an as-designed change. Global variables were treated a public by default, when they should have been “assembly”, as they are now. The correct fix is to mark them as public, if you want them accessible across the assembly level. I’ll reopen the issue to make sure it gets addressed for .NET as well.